Skip to content

Commit

Permalink
cli: Remove redundant GetVolumeSimpleInfo when setting user's perm
Browse files Browse the repository at this point in the history
There is no need to call GetVolumeSimpleInfo separately when setting
user's permission, since removeUserPolicy() or updateUserPolicy()
still checks if specific volume exists.

Signed-off-by: Sheng Yong <[email protected]>
  • Loading branch information
shyodx committed Nov 3, 2021
1 parent b605340 commit f3bc4b1
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions cli/cmd/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,6 @@ func newUserPermCmd(client *master.MasterClient) *cobra.Command {
if userInfo, err = client.UserAPI().GetUserInfo(userID); err != nil {
return
}
if _, err = client.AdminAPI().GetVolumeSimpleInfo(volume); err != nil {
return
}
if perm.IsNone() {
param := proto.NewUserPermRemoveParam(userID, volume)
userInfo, err = client.UserAPI().RemovePolicy(param)
Expand Down

0 comments on commit f3bc4b1

Please sign in to comment.