@@ -97,7 +97,8 @@ class BoardService {
|
||||
$userInfo = $this->getBoardPrerequisites();
|
||||
$userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since);
|
||||
$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null, $since);
|
||||
$complete = array_merge($userBoards, $groupBoards);
|
||||
$circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since);
|
||||
$complete = array_merge($userBoards, $groupBoards, $circleBoards);
|
||||
$result = [];
|
||||
/** @var Board $item */
|
||||
foreach ($complete as &$item) {
|
||||
|
||||
@@ -33,6 +33,7 @@ use OCA\Deck\NoPermissionException;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\AppFramework\QueryException;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\ILogger;
|
||||
@@ -61,6 +62,8 @@ class PermissionService {
|
||||
/** @var array */
|
||||
private $users = [];
|
||||
|
||||
private $circlesEnabled = false;
|
||||
|
||||
public function __construct(
|
||||
ILogger $logger,
|
||||
AclMapper $aclMapper,
|
||||
@@ -79,6 +82,8 @@ class PermissionService {
|
||||
$this->shareManager = $shareManager;
|
||||
$this->config = $config;
|
||||
$this->userId = $userId;
|
||||
|
||||
$this->circlesEnabled = \OC::$server->getAppManager()->isEnabledForUser('circles');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,6 +187,16 @@ class PermissionService {
|
||||
if ($acl->getType() === Acl::PERMISSION_TYPE_USER && $acl->getParticipant() === $this->userId) {
|
||||
return $acl->getPermission($permission);
|
||||
}
|
||||
|
||||
if ($this->circlesEnabled && $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) {
|
||||
try {
|
||||
\OCA\Circles\Api\v1\Circles::getMember($acl->getParticipant(), $this->userId, 1);
|
||||
return $acl->getPermission($permission);
|
||||
} catch (\Exception $e) {
|
||||
// TODO: getMember doesn't work for personal circles
|
||||
$this->logger->info('Member not found in circle that was accessed. This should not happen.');
|
||||
}
|
||||
}
|
||||
}
|
||||
// check for groups
|
||||
$hasGroupPermission = false;
|
||||
|
||||
Reference in New Issue
Block a user