mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
auth: do not allow update root role
This commit is contained in:
parent
c0b5cc6c52
commit
030d1bbf2d
@ -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