mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
auth: fix gosimple errors
This commit is contained in:
parent
6ec4b9c26a
commit
55307d48ac
@ -459,11 +459,7 @@ func (as *authStore) UserGet(r *pb.AuthUserGetRequest) (*pb.AuthUserGetResponse,
|
|||||||
if user == nil {
|
if user == nil {
|
||||||
return nil, ErrUserNotFound
|
return nil, ErrUserNotFound
|
||||||
}
|
}
|
||||||
|
resp.Roles = append(resp.Roles, user.Roles...)
|
||||||
for _, role := range user.Roles {
|
|
||||||
resp.Roles = append(resp.Roles, role)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &resp, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,11 +525,7 @@ func (as *authStore) RoleGet(r *pb.AuthRoleGetRequest) (*pb.AuthRoleGetResponse,
|
|||||||
if role == nil {
|
if role == nil {
|
||||||
return nil, ErrRoleNotFound
|
return nil, ErrRoleNotFound
|
||||||
}
|
}
|
||||||
|
resp.Perm = append(resp.Perm, role.KeyPermission...)
|
||||||
for _, perm := range role.KeyPermission {
|
|
||||||
resp.Perm = append(resp.Perm, perm)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &resp, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user