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;
|
||||
}
|
||||
|
||||
$board = $this->getBoard($boardId);
|
||||
$owner = $this->userIsBoardOwner($boardId, $userId);
|
||||
$acls = $board->getDeletedAt() === 0 ? $this->aclMapper->findAll($boardId) : [];
|
||||
try {
|
||||
$board = $this->getBoard($boardId);
|
||||
$owner = $this->userIsBoardOwner($boardId, $userId);
|
||||
$acls = $board->getDeletedAt() === 0 ? $this->aclMapper->findAll($boardId) : [];
|
||||
} catch (MultipleObjectsReturnedException|DoesNotExistException $e) {
|
||||
$owner = false;
|
||||
$acls = [];
|
||||
}
|
||||
|
||||
$permissions = [
|
||||
Acl::PERMISSION_READ => $owner || $this->userCan($acls, Acl::PERMISSION_READ, $userId),
|
||||
Acl::PERMISSION_EDIT => $owner || $this->userCan($acls, Acl::PERMISSION_EDIT, $userId),
|
||||
|
||||
Reference in New Issue
Block a user