From ed38e70989ad1589efe64e029af31c7591c42876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 22 Mar 2019 13:57:39 +0100 Subject: [PATCH] Properly fetch infromation for personal circles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Db/BoardMapper.php | 6 +----- lib/Service/PermissionService.php | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Db/BoardMapper.php b/lib/Db/BoardMapper.php index 31a8cf43a..363916172 100644 --- a/lib/Db/BoardMapper.php +++ b/lib/Db/BoardMapper.php @@ -234,20 +234,16 @@ class BoardMapper extends DeckMapper implements IPermissionMapper { \OC::$server->getLogger()->debug('Group ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant()); return null; } - // TODO: get circles list if ($acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) { try { - $circle = \OCA\Circles\Api\v1\Circles::detailsCircle($acl->getParticipant()); + $circle = \OCA\Circles\Api\v1\Circles::detailsCircle($acl->getParticipant(), true); if ($circle) { return new Circle($circle); } - } catch (QueryException $e) { } catch (\Exception $e) { - // TODO catch not found } return null; } - // TODO: get circles list throw new \Exception('Unknown permission type for mapping Acl'); }); } diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 3ea6530bf..edc26bd0d 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -190,10 +190,9 @@ class PermissionService { if ($this->circlesEnabled && $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) { 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); } 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.'); } }