|
36 | 36 | use OCP\Files\IMimeTypeDetector; |
37 | 37 | use OCP\Files\IRootFolder; |
38 | 38 | use OCP\Files\NotFoundException; |
| 39 | +use OCP\Group\ISubAdmin; |
39 | 40 | use OCP\Http\Client\IClientService; |
40 | 41 | use OCP\IAppConfig; |
41 | 42 | use OCP\IGroupManager; |
@@ -73,6 +74,7 @@ public function __construct( |
73 | 74 | private IURLGenerator $urlGenerator, |
74 | 75 | private Pkcs12Handler $pkcs12Handler, |
75 | 76 | private IGroupManager $groupManager, |
| 77 | + private ISubAdmin $subAdmin, |
76 | 78 | private IdDocsService $idDocsService, |
77 | 79 | private SignerElementsService $signerElementsService, |
78 | 80 | private UserElementMapper $userElementMapper, |
@@ -208,7 +210,8 @@ public function getConfig(?IUser $user = null): array { |
208 | 210 | $info['files_list_sorting_mode'] = $this->getUserConfigByKey('files_list_sorting_mode', $user) ?: 'name'; |
209 | 211 | $info['files_list_sorting_direction'] = $this->getUserConfigByKey('files_list_sorting_direction', $user) ?: 'asc'; |
210 | 212 | $info['policy_workbench_catalog_compact_view'] = $this->getUserConfigByKey('policy_workbench_catalog_compact_view', $user) === '1'; |
211 | | - $info['can_manage_group_policies'] = $user !== null && $this->groupManager->isAdmin($user->getUID()); |
| 213 | + $info['can_manage_group_policies'] = $user !== null |
| 214 | + && ($this->groupManager->isAdmin($user->getUID()) || $this->subAdmin->isSubAdmin($user)); |
212 | 215 |
|
213 | 216 | return array_filter($info, static fn (mixed $value): bool => $value !== null && $value !== ''); |
214 | 217 | } |
|
0 commit comments