diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 27465e351..2d79fafa3 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -214,7 +214,7 @@ class PermissionService { } try { - $board = $this->boardMapper->find($boardId); + $board = $this->getBoard($boardId); } catch (DoesNotExistException $e) { return []; } catch (MultipleObjectsReturnedException $e) { @@ -227,7 +227,7 @@ class PermissionService { } else { $users[$board->getOwner()] = new User($board->getOwner(), $this->userManager); } - $acls = $this->aclMapper->findAll($boardId); + $acls = $board->getAcl(); /** @var Acl $acl */ foreach ($acls as $acl) { if ($acl->getType() === Acl::PERMISSION_TYPE_USER) { diff --git a/tests/unit/Service/PermissionServiceTest.php b/tests/unit/Service/PermissionServiceTest.php index a25a325d5..70160dc8a 100644 --- a/tests/unit/Service/PermissionServiceTest.php +++ b/tests/unit/Service/PermissionServiceTest.php @@ -347,9 +347,8 @@ class PermissionServiceTest extends \Test\TestCase { ->method('__call') ->with('getOwner', []) ->willReturn('user1'); - $this->aclMapper->expects($this->once()) - ->method('findAll') - ->with(123) + $board->expects($this->any()) + ->method('getAcl') ->willReturn([$aclUser, $aclGroup]); $this->boardMapper->expects($this->once()) ->method('find')