mirror of
https://github.com/minio/minio.git
synced 2025-04-17 01:10:29 -04:00
svc: Disallow creating services accounts by root (#12062)
This commit is contained in:
parent
291d2793ca
commit
150f3677d6
@ -491,6 +491,12 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Disallow creating service accounts by root user.
|
// Disallow creating service accounts by root user.
|
||||||
|
if owner {
|
||||||
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminAccountNotEligible), r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disallow creating service accounts for root user.
|
||||||
if createReq.TargetUser == globalActiveCred.AccessKey {
|
if createReq.TargetUser == globalActiveCred.AccessKey {
|
||||||
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminAccountNotEligible), r.URL)
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAdminAccountNotEligible), r.URL)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user