mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #3044 from xiang90/fix_auth_update_role
auth: do not allow update root role
This commit is contained in:
commit
96c0c7a202
@ -338,6 +338,9 @@ func (s *Store) DeleteRole(name string) error {
|
||||
}
|
||||
|
||||
func (s *Store) UpdateRole(role Role) (Role, error) {
|
||||
if role.Role == RootRoleName {
|
||||
return Role{}, authErr(http.StatusForbidden, "Cannot modify role %s: is root role.", role.Role)
|
||||
}
|
||||
old, err := s.GetRole(role.Role)
|
||||
if err != nil {
|
||||
if e, ok := err.(*etcderr.Error); ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user