File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 3333use OCP \Share \Exceptions \ShareNotFound ;
3434use OCP \Share \IManager ;
3535use OCP \Share \IShare ;
36+ use OCP \Share \IShareProviderGetUsers ;
3637
3738/** Taken from the talk shareapicontroller helper */
3839interface IShareProviderBackend {
@@ -42,7 +43,7 @@ public function formatShare(IShare $share): array;
4243 public function canAccessShare (IShare $ share , string $ user ): bool ;
4344}
4445
45- class DeckShareProvider implements \OCP \Share \IShareProvider {
46+ class DeckShareProvider implements \OCP \Share \IShareProvider, IShareProviderGetUsers {
4647 public const DECK_FOLDER = '/Deck ' ;
4748 public const DECK_FOLDER_PLACEHOLDER = '/{DECK_PLACEHOLDER} ' ;
4849
@@ -1067,4 +1068,20 @@ public function getOrphanedAttachmentShares(): array {
10671068
10681069 return $ shares ;
10691070 }
1071+
1072+ public function getUsersForShare (IShare $ share ): iterable {
1073+ if ($ share ->getShareType () === IShare::TYPE_DECK ) {
1074+ $ cardId = (int )$ share ->getSharedWith ();
1075+ $ boardId = $ this ->cardMapper ->findBoardId ($ cardId );
1076+ if ($ boardId === null ) {
1077+ return [];
1078+ }
1079+
1080+ foreach ($ this ->permissionService ->findUsers ($ boardId ) as $ user ) {
1081+ yield $ user ->getUserObject ();
1082+ }
1083+ }
1084+
1085+ return [];
1086+ }
10701087}
You can’t perform that action at this time.
0 commit comments