mirror of
https://github.com/usememos/memos.git
synced 2025-03-04 01:04:38 +08:00
fix: allow host role update user info (#2515)
This commit is contained in:
parent
0f126ec217
commit
d758ba2702
1 changed files with 1 additions and 1 deletions
|
@ -96,7 +96,7 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs
|
|||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
||||
}
|
||||
if currentUser.Username != username && currentUser.Role != store.RoleAdmin {
|
||||
if currentUser.Username != username && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost {
|
||||
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||
}
|
||||
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
|
||||
|
|
Loading…
Reference in a new issue