mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-17 02:15:28 +00:00
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:
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user