Add support for multiple admins (#8487)

Also define IAM policies for administering
MinIO server
This commit is contained in:
poornas
2019-11-19 02:03:18 -08:00
committed by kannappanr
parent 13a3d17321
commit 929951fd49
11 changed files with 401 additions and 54 deletions

View File

@@ -145,7 +145,7 @@ func (action Action) IsValid() bool {
// MarshalJSON - encodes Action to JSON data.
func (action Action) MarshalJSON() ([]byte, error) {
if action.IsValid() {
if action.IsValid() || AdminAction(action).IsValid() {
return json.Marshal(string(action))
}
@@ -171,6 +171,10 @@ func (action *Action) UnmarshalJSON(data []byte) error {
}
func parseAction(s string) (Action, error) {
adminAction, err := parseAdminAction(s)
if err == nil {
return Action(adminAction), nil
}
action := Action(s)
if action.IsValid() {