Versions in this module Expand all Collapse all v1 v1.5.0 Oct 24, 2022 Changes in this version + var Allow = errors.New("ent/privacy: allow rule") + var Deny = errors.New("ent/privacy: deny rule") + var Skip = errors.New("ent/privacy: skip rule") + func Allowf(format string, a ...interface{}) error + func DecisionContext(parent context.Context, decision error) context.Context + func Denyf(format string, a ...interface{}) error + func Skipf(format string, a ...interface{}) error + type CarMutationRuleFunc func(context.Context, *entv1.CarMutation) error + func (f CarMutationRuleFunc) EvalMutation(ctx context.Context, m entv1.Mutation) error + type CarQueryRuleFunc func(context.Context, *entv1.CarQuery) error + func (f CarQueryRuleFunc) EvalQuery(ctx context.Context, q entv1.Query) error + type MutationPolicy []MutationRule + func (policy MutationPolicy) EvalMutation(ctx context.Context, m entv1.Mutation) error + type MutationRule interface + EvalMutation func(context.Context, entv1.Mutation) error + func DenyMutationOperationRule(op entv1.Op) MutationRule + func OnMutationOperation(rule MutationRule, op entv1.Op) MutationRule + type MutationRuleFunc func(context.Context, entv1.Mutation) error + func (f MutationRuleFunc) EvalMutation(ctx context.Context, m entv1.Mutation) error + type Policy struct + Mutation MutationPolicy + Query QueryPolicy + func (policy Policy) EvalMutation(ctx context.Context, m entv1.Mutation) error + func (policy Policy) EvalQuery(ctx context.Context, q entv1.Query) error + type QueryMutationRule interface + func AlwaysAllowRule() QueryMutationRule + func AlwaysDenyRule() QueryMutationRule + func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule + type QueryPolicy []QueryRule + func (policy QueryPolicy) EvalQuery(ctx context.Context, q entv1.Query) error + type QueryRule interface + EvalQuery func(context.Context, entv1.Query) error + type QueryRuleFunc func(context.Context, entv1.Query) error + func (f QueryRuleFunc) EvalQuery(ctx context.Context, q entv1.Query) error + type UserMutationRuleFunc func(context.Context, *entv1.UserMutation) error + func (f UserMutationRuleFunc) EvalMutation(ctx context.Context, m entv1.Mutation) error + type UserQueryRuleFunc func(context.Context, *entv1.UserQuery) error + func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q entv1.Query) error