diff options
author | dartcafe <github@dartcafe.de> | 2021-09-05 19:43:15 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2021-09-05 19:43:15 +0300 |
commit | 45b6e61557fedafd76366908f979684706d65f19 (patch) | |
tree | 5b56f6a6bd3c05b41456bc211f698de9594eb3ed /lib/Service/ShareService.php | |
parent | a1415ea131710e4d4ada0f55a0d8b56508520ef0 (diff) |
refactoring and let settings have an affect
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'lib/Service/ShareService.php')
-rw-r--r-- | lib/Service/ShareService.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index f2dec182..a10e961e 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -244,7 +244,9 @@ class ShareService { public function add(int $pollId, string $type, string $userId = ''): Share { $this->acl->setPollId($pollId, Acl::PERMISSION_POLL_EDIT); - if ($type !== UserGroupClass::TYPE_PUBLIC) { + if ($type === UserGroupClass::TYPE_PUBLIC) { + $this->acl->request(ACL::PERMISSION_PUBLIC_SHARES); + } else { try { $this->shareMapper->findByPollAndUser($pollId, $userId); throw new ShareAlreadyExistsException; |