Skip to content

Commit

Permalink
fix lint issue
Browse files Browse the repository at this point in the history
Signed-off-by: yxxhero <aiopsclub@163.com>
  • Loading branch information
yxxhero authored and gaius-qi committed Aug 31, 2021
1 parent cedf68a commit 80971e5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions manager/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,16 @@ func (s *rest) ResetPassword(uid uint, userName string, json types.ResetPassword
return err
}
return updatePassword(uid, json.NewPassword)
} else {
// validate user permission
has, err := s.enforcer.Enforce(userName, "users", "*")
if err != nil {
return err
}
if !has {
return errors.New("permission deny")
}
return updatePassword(uid, json.NewPassword)
}
// validate user permission
has, err := s.enforcer.Enforce(userName, "users", "*")
if err != nil {
return err
}
if !has {
return errors.New("permission deny")
}
return updatePassword(uid, json.NewPassword)
}

func (s *rest) #(json types.#Request) (*model.User, error) {
Expand Down

0 comments on commit 80971e5

Please # to comment.