nextcloud/apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php
provokateurin 653d2a05b4
feat(files_sharing): Support multiples users in UserShareAccessUpdatedEvent
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-01-15 11:07:15 +01:00

44 lines
945 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Files_Sharing\Event;
use OCP\AppFramework\Attribute\Dispatchable;
use OCP\EventDispatcher\Event;
use OCP\IUser;
/**
* 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<IUser> $users */
private readonly array $users;
/**
* @param IUser|list<IUser> $users
*/
public function __construct(
IUser|array $users,
) {
parent::__construct();
$this->users = is_array($users) ? $users : [$users];
}
/**
* @return list<IUser>
*/
public function getUsers(): array {
return $this->users;
}
}