ent: github.com/facebookincubator/ent/entc/integration/ent/privacy Index | Files

package privacy

import "github.com/facebookincubator/ent/entc/integration/ent/privacy"

Index

Package Files

privacy.go

Variables

var (
    // Allow may be returned by rules to indicate that the policy
    // evaluation should terminate with an allow decision.
    Allow = errors.New("ent/privacy: allow rule")

    // Deny may be returned by rules to indicate that the policy
    // evaluation should terminate with an deny decision.
    Deny = errors.New("ent/privacy: deny rule")

    // Skip may be returned by rules to indicate that the policy
    // evaluation should continue to the next rule.
    Skip = errors.New("ent/privacy: skip rule")
)

func Allowf Uses

func Allowf(format string, a ...interface{}) error

Allowf returns an formatted wrapped Allow decision.

func Denyf Uses

func Denyf(format string, a ...interface{}) error

Denyf returns an formatted wrapped Deny decision.

func Skipf Uses

func Skipf(format string, a ...interface{}) error

Skipf returns an formatted wrapped Skip decision.

type CardMutationRuleFunc Uses

type CardMutationRuleFunc func(context.Context, *ent.CardMutation) error

The CardMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (CardMutationRuleFunc) EvalMutation Uses

func (f CardMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type CardQueryRuleFunc Uses

type CardQueryRuleFunc func(context.Context, *ent.CardQuery) error

The CardQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (CardQueryRuleFunc) EvalQuery Uses

func (f CardQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type CommentMutationRuleFunc Uses

type CommentMutationRuleFunc func(context.Context, *ent.CommentMutation) error

The CommentMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (CommentMutationRuleFunc) EvalMutation Uses

func (f CommentMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type CommentQueryRuleFunc Uses

type CommentQueryRuleFunc func(context.Context, *ent.CommentQuery) error

The CommentQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (CommentQueryRuleFunc) EvalQuery Uses

func (f CommentQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type FieldTypeMutationRuleFunc Uses

type FieldTypeMutationRuleFunc func(context.Context, *ent.FieldTypeMutation) error

The FieldTypeMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FieldTypeMutationRuleFunc) EvalMutation Uses

func (f FieldTypeMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type FieldTypeQueryRuleFunc Uses

type FieldTypeQueryRuleFunc func(context.Context, *ent.FieldTypeQuery) error

The FieldTypeQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FieldTypeQueryRuleFunc) EvalQuery Uses

func (f FieldTypeQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type FileMutationRuleFunc Uses

type FileMutationRuleFunc func(context.Context, *ent.FileMutation) error

The FileMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FileMutationRuleFunc) EvalMutation Uses

func (f FileMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type FileQueryRuleFunc Uses

type FileQueryRuleFunc func(context.Context, *ent.FileQuery) error

The FileQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FileQueryRuleFunc) EvalQuery Uses

func (f FileQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type FileTypeMutationRuleFunc Uses

type FileTypeMutationRuleFunc func(context.Context, *ent.FileTypeMutation) error

The FileTypeMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FileTypeMutationRuleFunc) EvalMutation Uses

func (f FileTypeMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type FileTypeQueryRuleFunc Uses

type FileTypeQueryRuleFunc func(context.Context, *ent.FileTypeQuery) error

The FileTypeQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FileTypeQueryRuleFunc) EvalQuery Uses

func (f FileTypeQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type GroupInfoMutationRuleFunc Uses

type GroupInfoMutationRuleFunc func(context.Context, *ent.GroupInfoMutation) error

The GroupInfoMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupInfoMutationRuleFunc) EvalMutation Uses

func (f GroupInfoMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type GroupInfoQueryRuleFunc Uses

type GroupInfoQueryRuleFunc func(context.Context, *ent.GroupInfoQuery) error

The GroupInfoQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupInfoQueryRuleFunc) EvalQuery Uses

func (f GroupInfoQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type GroupMutationRuleFunc Uses

type GroupMutationRuleFunc func(context.Context, *ent.GroupMutation) error

The GroupMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupMutationRuleFunc) EvalMutation Uses

func (f GroupMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type GroupQueryRuleFunc Uses

type GroupQueryRuleFunc func(context.Context, *ent.GroupQuery) error

The GroupQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupQueryRuleFunc) EvalQuery Uses

func (f GroupQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type ItemMutationRuleFunc Uses

type ItemMutationRuleFunc func(context.Context, *ent.ItemMutation) error

The ItemMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (ItemMutationRuleFunc) EvalMutation Uses

func (f ItemMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type ItemQueryRuleFunc Uses

type ItemQueryRuleFunc func(context.Context, *ent.ItemQuery) error

The ItemQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (ItemQueryRuleFunc) EvalQuery Uses

func (f ItemQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type MutationPolicy Uses

type MutationPolicy []MutationRule

MutationPolicy combines multiple mutation rules into a single policy.

func (MutationPolicy) EvalMutation Uses

func (policy MutationPolicy) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation evaluates a mutation against a mutation policy.

type MutationRule Uses

type MutationRule interface {
    EvalMutation(context.Context, ent.Mutation) error
}

MutationRule defines the interface deciding whether a mutation is allowed and optionally modify it.

type MutationRuleFunc Uses

type MutationRuleFunc func(context.Context, ent.Mutation) error

MutationRuleFunc type is an adapter to allow the use of ordinary functions as mutation rules.

func (MutationRuleFunc) EvalMutation Uses

func (f MutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation returns f(ctx, m).

type NodeMutationRuleFunc Uses

type NodeMutationRuleFunc func(context.Context, *ent.NodeMutation) error

The NodeMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (NodeMutationRuleFunc) EvalMutation Uses

func (f NodeMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type NodeQueryRuleFunc Uses

type NodeQueryRuleFunc func(context.Context, *ent.NodeQuery) error

The NodeQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (NodeQueryRuleFunc) EvalQuery Uses

func (f NodeQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type PetMutationRuleFunc Uses

type PetMutationRuleFunc func(context.Context, *ent.PetMutation) error

The PetMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (PetMutationRuleFunc) EvalMutation Uses

func (f PetMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type PetQueryRuleFunc Uses

type PetQueryRuleFunc func(context.Context, *ent.PetQuery) error

The PetQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (PetQueryRuleFunc) EvalQuery Uses

func (f PetQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type Policy Uses

type Policy struct {
    Query    QueryPolicy
    Mutation MutationPolicy
}

Policy groups query and mutation policies.

func (Policy) EvalMutation Uses

func (policy Policy) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation forwards evaluation to mutation policy.

func (Policy) EvalQuery Uses

func (policy Policy) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery forwards evaluation to query policy.

type QueryMutationRule Uses

type QueryMutationRule interface {
    QueryRule
    MutationRule
}

QueryMutationRule is the interface that groups query and mutation rules.

func AlwaysAllowRule Uses

func AlwaysAllowRule() QueryMutationRule

AlwaysAllowRule returns a rule that returns an allow decision.

func AlwaysDenyRule Uses

func AlwaysDenyRule() QueryMutationRule

AlwaysDenyRule returns a rule that returns a deny decision.

type QueryPolicy Uses

type QueryPolicy []QueryRule

QueryPolicy combines multiple query rules into a single policy.

func (QueryPolicy) EvalQuery Uses

func (policy QueryPolicy) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery evaluates a query against a query policy.

type QueryRule Uses

type QueryRule interface {
    EvalQuery(context.Context, ent.Query) error
}

QueryRule defines the interface deciding whether a query is allowed and optionally modify it.

type QueryRuleFunc Uses

type QueryRuleFunc func(context.Context, ent.Query) error

QueryRuleFunc type is an adapter to allow the use of ordinary functions as query rules.

func (QueryRuleFunc) EvalQuery Uses

func (f QueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

Eval returns f(ctx, q).

type SpecMutationRuleFunc Uses

type SpecMutationRuleFunc func(context.Context, *ent.SpecMutation) error

The SpecMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (SpecMutationRuleFunc) EvalMutation Uses

func (f SpecMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type SpecQueryRuleFunc Uses

type SpecQueryRuleFunc func(context.Context, *ent.SpecQuery) error

The SpecQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (SpecQueryRuleFunc) EvalQuery Uses

func (f SpecQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

type UserMutationRuleFunc Uses

type UserMutationRuleFunc func(context.Context, *ent.UserMutation) error

The UserMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (UserMutationRuleFunc) EvalMutation Uses

func (f UserMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error

EvalMutation calls f(ctx, m).

type UserQueryRuleFunc Uses

type UserQueryRuleFunc func(context.Context, *ent.UserQuery) error

The UserQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (UserQueryRuleFunc) EvalQuery Uses

func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error

EvalQuery return f(ctx, q).

Package privacy imports 4 packages (graph). Updated 2020-03-22. Refresh now. Tools for package owners.