-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(users): Add users and group management to admin delegation #46418
Conversation
*/ | ||
public function getForm(): TemplateResponse { | ||
|
||
return new /** @template-extends TemplateResponse<Http::STATUS_OK, array{}> */ class($this->appName, '') extends TemplateResponse { |
Check failure
Code scanning / Psalm
InvalidTemplateParam Error
@@ -1300,7 +1318,10 @@ | |||
|
|||
// If not permitted | |||
$subAdminManager = $this->groupManager->getSubAdmin(); | |||
if (!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { | |||
$isAdmin = $this->groupManager->isAdmin($currentLoggedInUser->getUID()) || $this->groupManager->isDelegatedAdmin($currentLoggedInUser->getUID()); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
@@ -1329,7 +1350,8 @@ | |||
throw new OCSException('', OCSController::RESPOND_NOT_FOUND); | |||
} | |||
|
|||
if ($targetUser->getUID() === $loggedInUser->getUID() || $this->groupManager->isAdmin($loggedInUser->getUID())) { | |||
$isAdmin = $this->groupManager->isAdmin($loggedInUser->getUID()) || $this->groupManager->isDelegatedAdmin($loggedInUser->getUID()); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
@@ -1574,9 +1613,10 @@ | |||
|
|||
// Check if admin / subadmin | |||
$subAdminManager = $this->groupManager->getSubAdmin(); | |||
$isAdmin = $this->groupManager->isAdmin($currentLoggedInUser->getUID()) || $this->groupManager->isDelegatedAdmin($currentLoggedInUser->getUID()); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
2e9f01d
to
c255339
Compare
c255339
to
752f90c
Compare
78d9bf1
to
c710545
Compare
e62a668
to
1c5d27c
Compare
2a6824f
to
544bfd4
Compare
544bfd4
to
a2b98a7
Compare
28c2575
to
fb37346
Compare
Signed-off-by: Louis Chemineau <louis@chmn.me>
…nagement Signed-off-by: Louis Chemineau <louis@chmn.me>
4371d2e
to
15e73b4
Compare
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
15e73b4
to
7f0f671
Compare
Done
IDelegatedSettings
for users managementAuthorizedAdminSetting
annotation to endpoints that are admin restrictedI suspect the most critical part is to not let delegated admins escalate privileges to full admins. I tried to ensure that this is not possible. So a delegated admin cannot:
But a delegated admin can:
But I might have missed a scenario.