mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-27 14:48:45 +00:00
Merge commit from fork
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
"github.com/zitadel/zitadel/internal/repository/project"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
mgmt_pb "github.com/zitadel/zitadel/pkg/grpc/management"
|
||||
)
|
||||
|
||||
@@ -19,6 +20,9 @@ func (s *Server) GetProjectByID(ctx context.Context, req *mgmt_pb.GetProjectByID
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if project.ResourceOwner != authz.GetCtxData(ctx).OrgID {
|
||||
return nil, zerrors.ThrowNotFound(nil, "MANAG-SFf2a", "Errors.Project.NotFound")
|
||||
}
|
||||
return &mgmt_pb.GetProjectByIDResponse{
|
||||
Project: project_grpc.ProjectViewToPb(project),
|
||||
}, nil
|
||||
@@ -29,6 +33,9 @@ func (s *Server) GetGrantedProjectByID(ctx context.Context, req *mgmt_pb.GetGran
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !(grant.ResourceOwner == authz.GetCtxData(ctx).OrgID || grant.GrantedOrgID == authz.GetCtxData(ctx).OrgID) {
|
||||
return nil, zerrors.ThrowNotFound(nil, "MANAG-drt2a", "Errors.ProjectGrant.NotFound")
|
||||
}
|
||||
return &mgmt_pb.GetGrantedProjectByIDResponse{
|
||||
GrantedProject: project_grpc.GrantedProjectViewToPb(grant),
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user