@@ -18,7 +18,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go.probo.inc/probo/pkg/coredata"
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
"go.probo.inc/probo/pkg/gid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -46,15 +45,6 @@ func IdentityFromContext(ctx context.Context) *coredata.Identity {
|
|||||||
return identity
|
return identity
|
||||||
}
|
}
|
||||||
|
|
||||||
func IdentityIDFromContext(ctx context.Context) *gid.GID {
|
|
||||||
identity := IdentityFromContext(ctx)
|
|
||||||
if identity == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return &identity.ID
|
|
||||||
}
|
|
||||||
|
|
||||||
func ContextWithIdentity(ctx context.Context, identity *coredata.Identity) context.Context {
|
func ContextWithIdentity(ctx context.Context, identity *coredata.Identity) context.Context {
|
||||||
return context.WithValue(ctx, identityContextKey, identity)
|
return context.WithValue(ctx, identityContextKey, identity)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -945,7 +945,7 @@ func (r *mutationResolver) RecordAccessReviewEntryDecision(ctx context.Context,
|
|||||||
EntryID: input.AccessReviewEntryID,
|
EntryID: input.AccessReviewEntryID,
|
||||||
Decision: input.Decision,
|
Decision: input.Decision,
|
||||||
DecisionNote: input.DecisionNote,
|
DecisionNote: input.DecisionNote,
|
||||||
DecidedByID: authn.IdentityIDFromContext(ctx),
|
DecidedByID: &authn.IdentityFromContext(ctx).ID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -3529,7 +3529,7 @@ func (r *Resolver) RecordAccessReviewEntryDecisionTool(ctx context.Context, req
|
|||||||
EntryID: input.AccessReviewEntryID,
|
EntryID: input.AccessReviewEntryID,
|
||||||
Decision: input.Decision,
|
Decision: input.Decision,
|
||||||
DecisionNote: input.DecisionNote,
|
DecisionNote: input.DecisionNote,
|
||||||
DecidedByID: authn.IdentityIDFromContext(ctx),
|
DecidedByID: &authn.IdentityFromContext(ctx).ID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user