fix(admin): allow owner service account updates (#5889)

* fix(admin): allow owner service account updates

* test(admin): cover console admin update scope

Co-Authored-By: heihutu <heihutu@gmail.com>

---------

Co-authored-by: ccccpj <ccccpj@outlook.com>
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-08-09 16:46:27 +08:00
committed by GitHub
parent 2c7d0fb2ce
commit 27ecdb88b1
3 changed files with 296 additions and 4 deletions
+3 -1
View File
@@ -631,7 +631,9 @@ impl Operation for UpdateServiceAccount {
.await
.map_err(|e| map_service_account_lookup_error(e, "get service account failed"))?;
if !is_service_account_owner_of(&cred, &svc_account.parent_user) {
// The admin action permits updates within a caller's scope; only an
// owner may cross service-account parent boundaries.
if !owner && !is_service_account_owner_of(&cred, &svc_account.parent_user) {
return Err(s3_error!(AccessDenied, "access denied"));
}