mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
fix: queries (#2548)
* fix(second_factors): correct query, rename method * fix(multi_factors): correct query, correct naming * fix(project_grant): add project_id to queries * fix: simplify project id query constructor
This commit is contained in:
@@ -27,16 +27,16 @@ func (s *Server) ListProjectGrants(ctx context.Context, req *mgmt_pb.ListProject
|
||||
return nil, err
|
||||
}
|
||||
queries.AppendMyResourceOwnerQuery(authz.GetCtxData(ctx).OrgID)
|
||||
domains, err := s.query.SearchProjectGrants(ctx, queries)
|
||||
grants, err := s.query.SearchProjectGrants(ctx, queries)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ListProjectGrantsResponse{
|
||||
Result: proj_grpc.GrantedProjectViewsToPb(domains.ProjectGrants),
|
||||
Result: proj_grpc.GrantedProjectViewsToPb(grants.ProjectGrants),
|
||||
Details: object_grpc.ToListDetails(
|
||||
domains.Count,
|
||||
domains.Sequence,
|
||||
domains.Timestamp,
|
||||
grants.Count,
|
||||
grants.Sequence,
|
||||
grants.Timestamp,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
@@ -57,11 +57,11 @@ func (s *Server) AddProjectGrant(ctx context.Context, req *mgmt_pb.AddProjectGra
|
||||
}
|
||||
|
||||
func (s *Server) UpdateProjectGrant(ctx context.Context, req *mgmt_pb.UpdateProjectGrantRequest) (*mgmt_pb.UpdateProjectGrantResponse, error) {
|
||||
userGrants, err := s.usergrant.UserGrantsByProjectAndGrantID(ctx, req.ProjectId, req.GrantId)
|
||||
grants, err := s.usergrant.UserGrantsByProjectAndGrantID(ctx, req.ProjectId, req.GrantId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
grant, err := s.command.ChangeProjectGrant(ctx, UpdateProjectGrantRequestToDomain(req), authz.GetCtxData(ctx).OrgID, userGrantsToIDs(userGrants)...)
|
||||
grant, err := s.command.ChangeProjectGrant(ctx, UpdateProjectGrantRequestToDomain(req), authz.GetCtxData(ctx).OrgID, userGrantsToIDs(grants)...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user