Compare commits
3 Commits
test/base-
...
fix-duplic
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ebeeaa755 | ||
|
|
ce81c89b03 | ||
|
|
1e59511d8d |
@@ -45,8 +45,7 @@ class SessionMapper extends QBMapper {
|
|||||||
$qb->select('id', 'board_id', 'last_contact', 'user_id', 'token')
|
$qb->select('id', 'board_id', 'last_contact', 'user_id', 'token')
|
||||||
->from($this->getTableName())
|
->from($this->getTableName())
|
||||||
->where($qb->expr()->eq('board_id', $qb->createNamedParameter($boardId)))
|
->where($qb->expr()->eq('board_id', $qb->createNamedParameter($boardId)))
|
||||||
->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME)))
|
->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME)));
|
||||||
->executeQuery();
|
|
||||||
|
|
||||||
return $this->findEntities($qb);
|
return $this->findEntities($qb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -621,7 +621,9 @@ class BoardService {
|
|||||||
|
|
||||||
if ($fullDetails) {
|
if ($fullDetails) {
|
||||||
$this->enrichWithStacks($board);
|
$this->enrichWithStacks($board);
|
||||||
|
if ($board->getLabels() === null) {
|
||||||
$this->enrichWithLabels($board);
|
$this->enrichWithLabels($board);
|
||||||
|
}
|
||||||
$this->enrichWithUsers($board);
|
$this->enrichWithUsers($board);
|
||||||
$this->enrichWithBoardSettings($board);
|
$this->enrichWithBoardSettings($board);
|
||||||
$this->enrichWithActiveSessions($board);
|
$this->enrichWithActiveSessions($board);
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ class PermissionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$board = $this->boardMapper->find($boardId);
|
$board = $this->getBoard($boardId);
|
||||||
} catch (DoesNotExistException $e) {
|
} catch (DoesNotExistException $e) {
|
||||||
return [];
|
return [];
|
||||||
} catch (MultipleObjectsReturnedException $e) {
|
} catch (MultipleObjectsReturnedException $e) {
|
||||||
@@ -227,7 +227,7 @@ class PermissionService {
|
|||||||
} else {
|
} else {
|
||||||
$users[$board->getOwner()] = new User($board->getOwner(), $this->userManager);
|
$users[$board->getOwner()] = new User($board->getOwner(), $this->userManager);
|
||||||
}
|
}
|
||||||
$acls = $this->aclMapper->findAll($boardId);
|
$acls = $board->getAcl();
|
||||||
/** @var Acl $acl */
|
/** @var Acl $acl */
|
||||||
foreach ($acls as $acl) {
|
foreach ($acls as $acl) {
|
||||||
if ($acl->getType() === Acl::PERMISSION_TYPE_USER) {
|
if ($acl->getType() === Acl::PERMISSION_TYPE_USER) {
|
||||||
|
|||||||
@@ -347,9 +347,8 @@ class PermissionServiceTest extends \Test\TestCase {
|
|||||||
->method('__call')
|
->method('__call')
|
||||||
->with('getOwner', [])
|
->with('getOwner', [])
|
||||||
->willReturn('user1');
|
->willReturn('user1');
|
||||||
$this->aclMapper->expects($this->once())
|
$board->expects($this->any())
|
||||||
->method('findAll')
|
->method('getAcl')
|
||||||
->with(123)
|
|
||||||
->willReturn([$aclUser, $aclGroup]);
|
->willReturn([$aclUser, $aclGroup]);
|
||||||
$this->boardMapper->expects($this->once())
|
$this->boardMapper->expects($this->once())
|
||||||
->method('find')
|
->method('find')
|
||||||
|
|||||||
Reference in New Issue
Block a user