|
|
@ -429,6 +429,23 @@ func (sys *IAMSys) DeletePolicy(policyName string) error { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// InfoPolicy - expands the canned policy into its JSON structure.
|
|
|
|
|
|
|
|
func (sys *IAMSys) InfoPolicy(policyName string) ([]byte, error) { |
|
|
|
|
|
|
|
objectAPI := newObjectLayerFn() |
|
|
|
|
|
|
|
if objectAPI == nil { |
|
|
|
|
|
|
|
return nil, errServerNotInitialized |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sys.RLock() |
|
|
|
|
|
|
|
defer sys.RUnlock() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v, ok := sys.iamPolicyDocsMap[policyName] |
|
|
|
|
|
|
|
if !ok { |
|
|
|
|
|
|
|
return nil, errNoSuchPolicy |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return json.Marshal(v) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ListPolicies - lists all canned policies.
|
|
|
|
// ListPolicies - lists all canned policies.
|
|
|
|
func (sys *IAMSys) ListPolicies() (map[string][]byte, error) { |
|
|
|
func (sys *IAMSys) ListPolicies() (map[string][]byte, error) { |
|
|
|
objectAPI := newObjectLayerFn() |
|
|
|
objectAPI := newObjectLayerFn() |
|
|
@ -581,6 +598,7 @@ func (sys *IAMSys) GetUserInfo(name string) (u madmin.UserInfo, err error) { |
|
|
|
if sys.usersSysType != MinIOUsersSysType { |
|
|
|
if sys.usersSysType != MinIOUsersSysType { |
|
|
|
return madmin.UserInfo{ |
|
|
|
return madmin.UserInfo{ |
|
|
|
PolicyName: sys.iamUserPolicyMap[name].Policy, |
|
|
|
PolicyName: sys.iamUserPolicyMap[name].Policy, |
|
|
|
|
|
|
|
MemberOf: sys.iamUserGroupMemberships[name].ToSlice(), |
|
|
|
}, nil |
|
|
|
}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -892,9 +910,6 @@ func (sys *IAMSys) GetGroupDescription(group string) (gd madmin.GroupDesc, err e |
|
|
|
policy = ps[0] |
|
|
|
policy = ps[0] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sys.RLock() |
|
|
|
|
|
|
|
defer sys.RUnlock() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if sys.usersSysType != MinIOUsersSysType { |
|
|
|
if sys.usersSysType != MinIOUsersSysType { |
|
|
|
return madmin.GroupDesc{ |
|
|
|
return madmin.GroupDesc{ |
|
|
|
Name: group, |
|
|
|
Name: group, |
|
|
@ -902,6 +917,9 @@ func (sys *IAMSys) GetGroupDescription(group string) (gd madmin.GroupDesc, err e |
|
|
|
}, nil |
|
|
|
}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sys.RLock() |
|
|
|
|
|
|
|
defer sys.RUnlock() |
|
|
|
|
|
|
|
|
|
|
|
gi, ok := sys.iamGroupsMap[group] |
|
|
|
gi, ok := sys.iamGroupsMap[group] |
|
|
|
if !ok { |
|
|
|
if !ok { |
|
|
|
return gd, errNoSuchGroup |
|
|
|
return gd, errNoSuchGroup |
|
|
|