diff --git a/apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php b/apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php index a89ad566d4a97..1bbddd59c3bd6 100644 --- a/apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php +++ b/apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php @@ -9,24 +9,36 @@ namespace OCA\Files_Sharing\Event; +use OCP\AppFramework\Attribute\Dispatchable; use OCP\EventDispatcher\Event; use OCP\IUser; /** - * Emitted when a user *might* have gained or lost access to an existing share. + * Emitted when one or multiple users *might* have gained or lost access to an existing share. * * For example, when a user is added to a group, they gain access to all shares for the group. * * @since 33.0.0 */ +#[Dispatchable(since: '33.0.0')] class UserShareAccessUpdatedEvent extends Event { + /** @var list $users */ + private readonly array $users; + + /** + * @param IUser|list $users + */ public function __construct( - private readonly IUser $user, + IUser|array $users, ) { parent::__construct(); + $this->users = is_array($users) ? $users : [$users]; } - public function getUser(): IUser { - return $this->user; + /** + * @return list + */ + public function getUsers(): array { + return $this->users; } }