From e7fcef3e3a989fcdf19dd4c070dfdbc4f438666c Mon Sep 17 00:00:00 2001 From: Jakob Date: Tue, 15 Oct 2019 08:30:25 +0200 Subject: [PATCH 1/9] circle sharing Signed-off-by: Jakob --- lib/Service/PermissionService.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 2a815fe01..05a4e6939 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -262,6 +262,26 @@ class PermissionService { $users[$user->getUID()] = new User($user); } } + + if ($this->circlesEnabled && $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE) { + try { + $circle = \OCA\Circles\Api\v1\Circles::detailsCircle($acl->getParticipant(), true); + if ($circle === null) { + $this->logger->info('No circle found for acl rule ' . $acl->getId()); + continue; + } + + /* $b = $circle->getMember(); + + foreach ($circle['members'] as $user) { + $a = $user; + //$users[$user->userId()] = new User($user); + } */ + + } catch (\Exception $e) { + $this->logger->info('Member not found in circle that was accessed. This should not happen.'); + } + } } $this->users[(string) $boardId] = $users; return $this->users[(string) $boardId]; From 84dc4ce1dd2e69bf2073d7750bfeb8d48a204f59 Mon Sep 17 00:00:00 2001 From: Jakob Date: Tue, 15 Oct 2019 11:39:15 +0200 Subject: [PATCH 2/9] circles Signed-off-by: Jakob --- lib/Service/PermissionService.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 05a4e6939..4e3b460b3 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -270,14 +270,10 @@ class PermissionService { $this->logger->info('No circle found for acl rule ' . $acl->getId()); continue; } - - /* $b = $circle->getMember(); - - foreach ($circle['members'] as $user) { - $a = $user; - //$users[$user->userId()] = new User($user); - } */ - + + foreach ($circle->getMembers() as $user) { + //$users[$user->getUserId()] = new User($user); + } } catch (\Exception $e) { $this->logger->info('Member not found in circle that was accessed. This should not happen.'); } From e0808273ec5217ef496e9387964edf948de13d4f Mon Sep 17 00:00:00 2001 From: Jakob Date: Tue, 15 Oct 2019 13:56:12 +0200 Subject: [PATCH 3/9] get circle users Signed-off-by: Jakob --- lib/Service/PermissionService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 4e3b460b3..06784fb32 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -272,7 +272,8 @@ class PermissionService { } foreach ($circle->getMembers() as $user) { - //$users[$user->getUserId()] = new User($user); + $iuser = $this->userManager->get($user->getUserId()); + $users[$user->getUserId()] = new User($iuser); } } catch (\Exception $e) { $this->logger->info('Member not found in circle that was accessed. This should not happen.'); From 7628eb425cec7a3d1eee59af30ece2cc6ff1f635 Mon Sep 17 00:00:00 2001 From: Jakob Date: Wed, 16 Oct 2019 10:09:25 +0200 Subject: [PATCH 4/9] little changes Signed-off-by: Jakob --- lib/Service/PermissionService.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index 06784fb32..76a450d1c 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -271,9 +271,13 @@ class PermissionService { continue; } - foreach ($circle->getMembers() as $user) { - $iuser = $this->userManager->get($user->getUserId()); - $users[$user->getUserId()] = new User($iuser); + foreach ($circle->getMembers() as $member) { + $user = $this->userManager->get($member->getUserId()); + if ($user === null) { + $this->logger->info('No user found for circle member ' . $member->getUserId()); + } else { + $users[$member->getUserId()] = new User($user); + } } } catch (\Exception $e) { $this->logger->info('Member not found in circle that was accessed. This should not happen.'); From 08ef55c950021357a9a17a06a6b96d9d8d2ba469 Mon Sep 17 00:00:00 2001 From: Jakob Date: Wed, 16 Oct 2019 12:57:04 +0200 Subject: [PATCH 5/9] fix share users Signed-off-by: Jakob --- src/components/board/SharingTabSidebard.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/board/SharingTabSidebard.vue b/src/components/board/SharingTabSidebard.vue index 2c7470ec7..79e019135 100644 --- a/src/components/board/SharingTabSidebard.vue +++ b/src/components/board/SharingTabSidebard.vue @@ -20,7 +20,9 @@
  • - + +
    +
    {{ acl.participant.displayname }} @@ -97,9 +99,13 @@ export default { }, unallocatedSharees() { return this.sharees.filter((sharee) => { - return Object.values(this.board.acl).findIndex((acl) => { + let foundIndex = this.board.acl.findIndex((acl) => { return acl.participant.uid === sharee.value.shareWith }) + if (foundIndex === -1) { + return true + } + return false }) } }, From 23e88a7e15a36b8f376354c623c1e405411e43b9 Mon Sep 17 00:00:00 2001 From: Jakob Date: Fri, 18 Oct 2019 11:18:29 +0200 Subject: [PATCH 6/9] typos, css Signed-off-by: Jakob --- src/components/board/BoardSidebar.vue | 18 +++++++++--------- ...ngTabSidebard.vue => SharingTabSidebar.vue} | 14 +++++++++++--- ...{TagsTabSidebard.vue => TagsTabSidebar.vue} | 2 +- ...eTabSidebard.vue => TimelineTabSidebar.vue} | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) rename src/components/board/{SharingTabSidebard.vue => SharingTabSidebar.vue} (90%) rename src/components/board/{TagsTabSidebard.vue => TagsTabSidebar.vue} (99%) rename src/components/board/{TimelineTabSidebard.vue => TimelineTabSidebar.vue} (97%) diff --git a/src/components/board/BoardSidebar.vue b/src/components/board/BoardSidebar.vue index a283d7e55..4c880a889 100644 --- a/src/components/board/BoardSidebar.vue +++ b/src/components/board/BoardSidebar.vue @@ -27,11 +27,11 @@ @close="closeSidebar"> - + - + @@ -39,7 +39,7 @@ - + @@ -47,10 +47,10 @@