Versions in this module Expand all Collapse all v2 v2.0.1 Feb 2, 2026 Changes in this version + func ApplyScope(filters map[string]any, scope Scope) map[string]any + func MaskFields(input map[string]any, denied []string) map[string]any + func ProjectFields(input map[string]any, allowed []string) map[string]any + func Require(ctx context.Context, auth ports.Authorizer, subject any, action string, ...) error + func RequireOwner(subjectID string, resource Owner) error + func RequireOwnerID(subjectID, ownerID string) error + func RequireTenant(tenantID string, resource TenantOwned) error + func TenantIDFromContext(ctx context.Context) (string, bool) + func WithScope(ctx context.Context, scope Scope) context.Context + type AllowlistAuthorizer struct + func NewAllowlistAuthorizer() *AllowlistAuthorizer + func (a *AllowlistAuthorizer) Allow(action string, auth ports.Authorizer) error + func (a *AllowlistAuthorizer) AllowAny(action string) error + func (a *AllowlistAuthorizer) AllowFunc(action string, fn ports.AuthorizerFunc) error + func (a *AllowlistAuthorizer) Can(ctx context.Context, subject any, action string, resource any) error + type Owner interface + OwnerID func() string + type PolicyAuthorizer struct + func NewPolicyAuthorizer(engine ports.PolicyEngine, opts PolicyAuthorizerOptions) *PolicyAuthorizer + func (p *PolicyAuthorizer) Can(ctx context.Context, subject any, action string, resource any) error + type PolicyAuthorizerOptions struct + ContextProvider PolicyContextProvider + DenyOnError bool + type PolicyContextProvider func(ctx context.Context) any + type Scope struct + TenantID string + UserID string + func ScopeFromContext(ctx context.Context) (Scope, bool) + func (s Scope) Filters() map[string]any + type TenantOwned interface + TenantID func() string