mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Allow users to list their own service accounts (#13706)
Bonus: add extensive tests for svc acc actions by users
This commit is contained in:
committed by
GitHub
parent
556ae07857
commit
40244994ad
@@ -939,8 +939,10 @@ func (a adminAPIHandlers) ListServiceAccounts(w http.ResponseWriter, r *http.Req
|
||||
|
||||
var targetAccount string
|
||||
|
||||
// If listing is requested for a specific user (who is not the request
|
||||
// sender), check that the user has permissions.
|
||||
user := r.Form.Get("user")
|
||||
if user != "" {
|
||||
if user != "" && user != cred.AccessKey {
|
||||
if !globalIAMSys.IsAllowed(iampolicy.Args{
|
||||
AccountName: cred.AccessKey,
|
||||
Action: iampolicy.ListServiceAccountsAdminAction,
|
||||
|
||||
Reference in New Issue
Block a user