fix(PermissionService#getPermissions): Catch exceptions from getBoard method
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
committed by
backportbot[bot]
parent
eaa639e9ba
commit
16286010ef
@@ -108,9 +108,15 @@ class PermissionService {
|
|||||||
return $cached;
|
return $cached;
|
||||||
}
|
}
|
||||||
|
|
||||||
$board = $this->getBoard($boardId);
|
try {
|
||||||
$owner = $this->userIsBoardOwner($boardId, $userId);
|
$board = $this->getBoard($boardId);
|
||||||
$acls = $board->getDeletedAt() === 0 ? $this->aclMapper->findAll($boardId) : [];
|
$owner = $this->userIsBoardOwner($boardId, $userId);
|
||||||
|
$acls = $board->getDeletedAt() === 0 ? $this->aclMapper->findAll($boardId) : [];
|
||||||
|
} catch (MultipleObjectsReturnedException|DoesNotExistException $e) {
|
||||||
|
$owner = false;
|
||||||
|
$acls = [];
|
||||||
|
}
|
||||||
|
|
||||||
$permissions = [
|
$permissions = [
|
||||||
Acl::PERMISSION_READ => $owner || $this->userCan($acls, Acl::PERMISSION_READ, $userId),
|
Acl::PERMISSION_READ => $owner || $this->userCan($acls, Acl::PERMISSION_READ, $userId),
|
||||||
Acl::PERMISSION_EDIT => $owner || $this->userCan($acls, Acl::PERMISSION_EDIT, $userId),
|
Acl::PERMISSION_EDIT => $owner || $this->userCan($acls, Acl::PERMISSION_EDIT, $userId),
|
||||||
|
|||||||
Reference in New Issue
Block a user