mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-02 00:48:52 +00:00
Merge commit from fork
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
object_grpc "github.com/zitadel/zitadel/internal/api/grpc/object"
|
||||
proj_grpc "github.com/zitadel/zitadel/internal/api/grpc/project"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
mgmt_pb "github.com/zitadel/zitadel/pkg/grpc/management"
|
||||
)
|
||||
|
||||
@@ -17,6 +18,9 @@ func (s *Server) GetProjectGrantByID(ctx context.Context, req *mgmt_pb.GetProjec
|
||||
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-d3g31", "Errors.ProjectGrant.NotFound")
|
||||
}
|
||||
return &mgmt_pb.GetProjectGrantByIDResponse{
|
||||
ProjectGrant: proj_grpc.GrantedProjectViewToPb(grant),
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user