@@ -10,7 +10,6 @@ import (
1010 "github.com/theopenlane/core/internal/ent/eventqueue"
1111 entgen "github.com/theopenlane/core/internal/ent/generated"
1212 "github.com/theopenlane/core/internal/ent/generated/organization"
13- "github.com/theopenlane/core/internal/ent/generated/privacy"
1413 "github.com/theopenlane/core/internal/ent/hooks/contextx"
1514 "github.com/theopenlane/core/pkg/gala"
1615 "github.com/theopenlane/core/pkg/logx"
@@ -82,8 +81,7 @@ func handleOrganizationCascadeDelete(ctx gala.HandlerContext, payload eventqueue
8281// organizationCleanupContext builds the context the cascade runs under, it bypasses privacy rules,
8382// turns the cascaded deletes into hard deletes and opts the cascade into purging history rows
8483func organizationCleanupContext (ctx context.Context , orgID string ) context.Context {
85- allowCtx := privacy .DecisionContext (ctx , privacy .Allow )
86- allowCtx = auth .WithCaller (allowCtx , newOrganizationCleanupCaller (orgID ))
84+ allowCtx := auth .WithCaller (ctx , newOrganizationCleanupCaller (orgID ))
8785
8886 allowCtx = entx .SkipSoftDelete (allowCtx )
8987
@@ -94,8 +92,7 @@ func organizationCleanupContext(ctx context.Context, orgID string) context.Conte
9492}
9593
9694// newOrganizationCleanupCaller returns the caller the cascade runs as. It needs to reach every
97- // record the organization owns regardless of who is deleting it, so it bypasses the organization
98- // filter and FGA checks and identifies itself as an internal operation
95+ // record the organization owns regardless of who is deleting it, so it bypasses FGA checks and identifies itself as an internal operation
9996func newOrganizationCleanupCaller (orgID string ) * auth.Caller {
10097 return & auth.Caller {
10198 OrganizationID : orgID ,
0 commit comments