(ctx context.Context, req *adminv1.GetUserRequest)
| 509 | } |
| 510 | |
| 511 | func (s *Server) GetUser(ctx context.Context, req *adminv1.GetUserRequest) (*adminv1.GetUserResponse, error) { |
| 512 | claims := auth.GetClaims(ctx) |
| 513 | if !claims.Superuser(ctx) { |
| 514 | return nil, status.Error(codes.PermissionDenied, "only superusers can get user") |
| 515 | } |
| 516 | |
| 517 | user, err := s.admin.DB.FindUserByEmail(ctx, req.Email) |
| 518 | if err != nil { |
| 519 | return nil, err |
| 520 | } |
| 521 | |
| 522 | return &adminv1.GetUserResponse{User: s.userToPB(user, false)}, nil |
| 523 | } |
| 524 | |
| 525 | func (s *Server) DeleteUser(ctx context.Context, req *adminv1.DeleteUserRequest) (*adminv1.DeleteUserResponse, error) { |
| 526 | observability.AddRequestAttributes(ctx, attribute.String("args.email", req.Email)) |
nothing calls this directly
no test coverage detected