-
Notifications
You must be signed in to change notification settings - Fork 310
chore/share provide get users #7499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
| namespace OCA\Deck\Listeners; | ||
|
|
||
| use OCA\Deck\Event\AclCreatedEvent; | ||
| use OCA\Deck\Event\AclDeletedEvent; | ||
| use OCA\Files_Sharing\Event\UserShareAccessUpdatedEvent; | ||
| use OCP\EventDispatcher\Event; | ||
| use OCP\EventDispatcher\IEventDispatcher; | ||
| use OCP\EventDispatcher\IEventListener; | ||
| use OCP\IGroupManager; | ||
| use OCP\IUserManager; | ||
| use OCP\Share\IShare; | ||
|
|
||
| class AclCreatedRemovedListener implements IEventListener { | ||
|
Check failure on line 19 in lib/Listeners/AclCreatedRemovedListener.php
|
||
| public function __construct( | ||
| private IGroupManager $groupManager, | ||
| private IEventDispatcher $eventDispatcher, | ||
| private IUserManager $userManager, | ||
| ) { | ||
| } | ||
|
|
||
| public function handle(Event $event): void { | ||
| if (!$event instanceof AclDeletedEvent && !$event instanceof AclCreatedEvent) { | ||
| return; | ||
| } | ||
|
|
||
| $acl = $event->getAcl(); | ||
| if ($acl->getType() === IShare::TYPE_GROUP) { | ||
| $group = $this->groupManager->get($acl->getParticipant()); | ||
| foreach ($group->getUsers() as $user) { | ||
| $this->eventDispatcher->dispatchTyped(new UserShareAccessUpdatedEvent($user)); | ||
|
Check failure on line 36 in lib/Listeners/AclCreatedRemovedListener.php
|
||
| } | ||
| } else { | ||
| $user = $this->userManager->get($acl->getParticipant()); | ||
| $this->eventDispatcher->dispatchTyped(new UserShareAccessUpdatedEvent($user)); | ||
|
Check failure on line 40 in lib/Listeners/AclCreatedRemovedListener.php
|
||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be missing circles handling?