зеркало из https://github.com/nextcloud/deck.git
fix(PermissionService#getPermissions): Catch exceptions from getBoard method
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Родитель
a302b554c8
Коммит
357397a2dd
|
@ -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),
|
||||
|
|
Загрузка…
Ссылка в новой задаче