Skip to content

Commit c2a177d

Browse files
committed
feat: add event for apps that a users share access might have changed
Signed-off-by: Robin Appelman <[email protected]>
1 parent 9f7d4d0 commit c2a177d

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

apps/files_sharing/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => $baseDir . '/../lib/Event/BeforeTemplateRenderedEvent.php',
4646
'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => $baseDir . '/../lib/Event/ShareLinkAccessedEvent.php',
4747
'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => $baseDir . '/../lib/Event/ShareMountedEvent.php',
48+
'OCA\\Files_Sharing\\Event\\UserShareAccessUpdatedEvent' => $baseDir . '/../lib/Event/UserShareAccessUpdatedEvent.php',
4849
'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => $baseDir . '/../lib/Exceptions/BrokenPath.php',
4950
'OCA\\Files_Sharing\\Exceptions\\S2SException' => $baseDir . '/../lib/Exceptions/S2SException.php',
5051
'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => $baseDir . '/../lib/Exceptions/SharingRightsException.php',

apps/files_sharing/composer/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class ComposerStaticInitFiles_Sharing
6060
'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => __DIR__ . '/..' . '/../lib/Event/BeforeTemplateRenderedEvent.php',
6161
'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => __DIR__ . '/..' . '/../lib/Event/ShareLinkAccessedEvent.php',
6262
'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => __DIR__ . '/..' . '/../lib/Event/ShareMountedEvent.php',
63+
'OCA\\Files_Sharing\\Event\\UserShareAccessUpdatedEvent' => __DIR__ . '/..' . '/../lib/Event/UserShareAccessUpdatedEvent.php',
6364
'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => __DIR__ . '/..' . '/../lib/Exceptions/BrokenPath.php',
6465
'OCA\\Files_Sharing\\Exceptions\\S2SException' => __DIR__ . '/..' . '/../lib/Exceptions/S2SException.php',
6566
'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => __DIR__ . '/..' . '/../lib/Exceptions/SharingRightsException.php',
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2026 Robin Appelman <[email protected]>
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
namespace OCA\Files_Sharing\Event;
11+
12+
use OCP\EventDispatcher\Event;
13+
use OCP\IUser;
14+
15+
/**
16+
* Emitted when a user *might* have gained or lost access to an existing share.
17+
*
18+
* For example, when a user is added to a group, they gain access to all shares for the group.
19+
*
20+
* @since 33.0.0
21+
*/
22+
class UserShareAccessUpdatedEvent extends Event {
23+
public function __construct(
24+
private readonly IUser $user,
25+
) {
26+
parent::__construct();
27+
}
28+
29+
public function getUser(): IUser {
30+
return $this->user;
31+
}
32+
}

0 commit comments

Comments
 (0)