Properly fetch infromation for personal circles
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -234,20 +234,16 @@ class BoardMapper extends DeckMapper implements IPermissionMapper {
|
|||||||
\OC::$server->getLogger()->debug('Group ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant());
|
\OC::$server->getLogger()->debug('Group ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// TODO: get circles list
|
|
||||||
if ($acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) {
|
if ($acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) {
|
||||||
try {
|
try {
|
||||||
$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($acl->getParticipant());
|
$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($acl->getParticipant(), true);
|
||||||
if ($circle) {
|
if ($circle) {
|
||||||
return new Circle($circle);
|
return new Circle($circle);
|
||||||
}
|
}
|
||||||
} catch (QueryException $e) {
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// TODO catch not found
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// TODO: get circles list
|
|
||||||
throw new \Exception('Unknown permission type for mapping Acl');
|
throw new \Exception('Unknown permission type for mapping Acl');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,10 +190,9 @@ class PermissionService {
|
|||||||
|
|
||||||
if ($this->circlesEnabled && $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) {
|
if ($this->circlesEnabled && $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) {
|
||||||
try {
|
try {
|
||||||
\OCA\Circles\Api\v1\Circles::getMember($acl->getParticipant(), $this->userId, 1);
|
\OCA\Circles\Api\v1\Circles::getMember($acl->getParticipant(), $this->userId, 1, true);
|
||||||
return $acl->getPermission($permission);
|
return $acl->getPermission($permission);
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
$this->logger->info('Member not found in circle that was accessed. This should not happen.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user