mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
Set the policy mapping for a user or group (#8036)
Add API to set policy mapping for a user or group Contains a breaking Admin APIs change. - Also enforce all applicable policies - Removes the previous /set-user-policy API Bump up peerRESTVersion Add get user info API to show groups of a user
This commit is contained in:
committed by
kannappanr
parent
bc79b435a2
commit
bf9b619d86
@@ -406,6 +406,22 @@ func (client *peerRESTClient) LoadPolicy(policyName string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// LoadPolicyMapping - reload a specific policy mapping
|
||||
func (client *peerRESTClient) LoadPolicyMapping(userOrGroup string, isGroup bool) error {
|
||||
values := make(url.Values)
|
||||
values.Set(peerRESTUserOrGroup, userOrGroup)
|
||||
if isGroup {
|
||||
values.Set(peerRESTIsGroup, "")
|
||||
}
|
||||
|
||||
respBody, err := client.call(peerRESTMethodLoadPolicyMapping, values, nil, -1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer http.DrainBody(respBody)
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteUser - delete a specific user.
|
||||
func (client *peerRESTClient) DeleteUser(accessKey string) (err error) {
|
||||
values := make(url.Values)
|
||||
|
||||
Reference in New Issue
Block a user