mirror of
https://github.com/nextcloud/server.git
synced 2026-03-23 19:03:20 -04:00
Merge pull request #57392 from nextcloud/user-share-access-event
feat: add event for apps that a users share access might have changed
This commit is contained in:
commit
2a2cd291d5
3 changed files with 34 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ return array(
|
|||
'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => $baseDir . '/../lib/Event/BeforeTemplateRenderedEvent.php',
|
||||
'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => $baseDir . '/../lib/Event/ShareLinkAccessedEvent.php',
|
||||
'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => $baseDir . '/../lib/Event/ShareMountedEvent.php',
|
||||
'OCA\\Files_Sharing\\Event\\UserShareAccessUpdatedEvent' => $baseDir . '/../lib/Event/UserShareAccessUpdatedEvent.php',
|
||||
'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => $baseDir . '/../lib/Exceptions/BrokenPath.php',
|
||||
'OCA\\Files_Sharing\\Exceptions\\S2SException' => $baseDir . '/../lib/Exceptions/S2SException.php',
|
||||
'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => $baseDir . '/../lib/Exceptions/SharingRightsException.php',
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class ComposerStaticInitFiles_Sharing
|
|||
'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => __DIR__ . '/..' . '/../lib/Event/BeforeTemplateRenderedEvent.php',
|
||||
'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => __DIR__ . '/..' . '/../lib/Event/ShareLinkAccessedEvent.php',
|
||||
'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => __DIR__ . '/..' . '/../lib/Event/ShareMountedEvent.php',
|
||||
'OCA\\Files_Sharing\\Event\\UserShareAccessUpdatedEvent' => __DIR__ . '/..' . '/../lib/Event/UserShareAccessUpdatedEvent.php',
|
||||
'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => __DIR__ . '/..' . '/../lib/Exceptions/BrokenPath.php',
|
||||
'OCA\\Files_Sharing\\Exceptions\\S2SException' => __DIR__ . '/..' . '/../lib/Exceptions/S2SException.php',
|
||||
'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => __DIR__ . '/..' . '/../lib/Exceptions/SharingRightsException.php',
|
||||
|
|
|
|||
32
apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php
Normal file
32
apps/files_sharing/lib/Event/UserShareAccessUpdatedEvent.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?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\EventDispatcher\Event;
|
||||
use OCP\IUser;
|
||||
|
||||
/**
|
||||
* Emitted when a user *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
|
||||
*/
|
||||
class UserShareAccessUpdatedEvent extends Event {
|
||||
public function __construct(
|
||||
private readonly IUser $user,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getUser(): IUser {
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue