@@ -182,7 +182,7 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
|||||||
|
|
||||||
// shared with user
|
// shared with user
|
||||||
$qb->resetQueryParts();
|
$qb->resetQueryParts();
|
||||||
$qb->selectDistinct('b.id', 'title', 'owner', 'color', 'archived', 'deleted_at', 'last_modified')
|
$qb->select('b.id', 'title', 'owner', 'color', 'archived', 'deleted_at', 'last_modified')
|
||||||
//->selectAlias('1', 'shared')
|
//->selectAlias('1', 'shared')
|
||||||
->from('deck_boards', 'b')
|
->from('deck_boards', 'b')
|
||||||
->innerJoin('b', 'deck_board_acl', 'acl', $qb->expr()->eq('b.id', 'acl.board_id'))
|
->innerJoin('b', 'deck_board_acl', 'acl', $qb->expr()->eq('b.id', 'acl.board_id'))
|
||||||
|
|||||||
@@ -528,7 +528,7 @@ class BoardService {
|
|||||||
$this->boardMapper->mapAcl($newAcl);
|
$this->boardMapper->mapAcl($newAcl);
|
||||||
$this->changeHelper->boardChanged($boardId);
|
$this->changeHelper->boardChanged($boardId);
|
||||||
|
|
||||||
$board = $this->find($boardId);
|
$board = $this->boardMapper->find($boardId);
|
||||||
$this->clearBoardFromCache($board);
|
$this->clearBoardFromCache($board);
|
||||||
|
|
||||||
// TODO: use the dispatched event for this
|
// TODO: use the dispatched event for this
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ class PermissionService {
|
|||||||
if (array_key_exists((string) $boardId, $this->users) && !$refresh) {
|
if (array_key_exists((string) $boardId, $this->users) && !$refresh) {
|
||||||
return $this->users[(string) $boardId];
|
return $this->users[(string) $boardId];
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$board = $this->boardMapper->find($boardId);
|
$board = $this->boardMapper->find($boardId);
|
||||||
} catch (DoesNotExistException $e) {
|
} catch (DoesNotExistException $e) {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class BoardServiceTest extends TestCase {
|
|||||||
->method('find')
|
->method('find')
|
||||||
->with(1)
|
->with(1)
|
||||||
->willReturn($b1);
|
->willReturn($b1);
|
||||||
$this->permissionService->expects($this->once())
|
$this->permissionService->expects($this->any())
|
||||||
->method('findUsers')
|
->method('findUsers')
|
||||||
->willReturn([
|
->willReturn([
|
||||||
'admin' => 'admin',
|
'admin' => 'admin',
|
||||||
@@ -258,6 +258,11 @@ class BoardServiceTest extends TestCase {
|
|||||||
->method('insert')
|
->method('insert')
|
||||||
->with($acl)
|
->with($acl)
|
||||||
->willReturn($acl);
|
->willReturn($acl);
|
||||||
|
$this->permissionService->expects($this->any())
|
||||||
|
->method('findUsers')
|
||||||
|
->willReturn([
|
||||||
|
'admin' => 'admin',
|
||||||
|
]);
|
||||||
$this->assertEquals($acl, $this->service->addAcl(
|
$this->assertEquals($acl, $this->service->addAcl(
|
||||||
123, 'user', 'admin', true, true, true
|
123, 'user', 'admin', true, true, true
|
||||||
));
|
));
|
||||||
@@ -333,16 +338,6 @@ class BoardServiceTest extends TestCase {
|
|||||||
$currentUserAcl[1],
|
$currentUserAcl[1],
|
||||||
$currentUserAcl[2]
|
$currentUserAcl[2]
|
||||||
);
|
);
|
||||||
|
|
||||||
/* $this->permissionService->expects($this->at(2))
|
|
||||||
->method('userCan')
|
|
||||||
->willReturn($currentUserAcl[0]);
|
|
||||||
$this->permissionService->expects($this->at(3))
|
|
||||||
->method('userCan')
|
|
||||||
->willReturn($currentUserAcl[1]);
|
|
||||||
$this->permissionService->expects($this->at(4))
|
|
||||||
->method('userCan')
|
|
||||||
->willReturn($currentUserAcl[2]); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->createMock(IUser::class);
|
$user = $this->createMock(IUser::class);
|
||||||
@@ -357,6 +352,11 @@ class BoardServiceTest extends TestCase {
|
|||||||
$acl->resolveRelation('participant', function ($participant) use (&$user) {
|
$acl->resolveRelation('participant', function ($participant) use (&$user) {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
$this->permissionService->expects($this->any())
|
||||||
|
->method('findUsers')
|
||||||
|
->willReturn([
|
||||||
|
'admin' => 'admin',
|
||||||
|
]);
|
||||||
$this->notificationHelper->expects($this->once())
|
$this->notificationHelper->expects($this->once())
|
||||||
->method('sendBoardShared');
|
->method('sendBoardShared');
|
||||||
$expected = clone $acl;
|
$expected = clone $acl;
|
||||||
|
|||||||
Reference in New Issue
Block a user