mirror of
https://github.com/usememos/memos.git
synced 2025-10-12 15:26:07 +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 {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
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")
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
}
|
}
|
||||||
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
|
if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue