// Code generated by ent, DO NOT EDIT.

package privacy

import (
	"context"

	"github.com/anzhiyu-c/anheyu-app/ent"

	"entgo.io/ent/privacy"
)

var (
	// Allow may be returned by rules to indicate that the policy
	// evaluation should terminate with allow decision.
	Allow = privacy.Allow

	// Deny may be returned by rules to indicate that the policy
	// evaluation should terminate with deny decision.
	Deny = privacy.Deny

	// Skip may be returned by rules to indicate that the policy
	// evaluation should continue to the next rule.
	Skip = privacy.Skip
)

// Allowf returns a formatted wrapped Allow decision.
func Allowf(format string, a ...any) error {
	return privacy.Allowf(format, a...)
}

// Denyf returns a formatted wrapped Deny decision.
func Denyf(format string, a ...any) error {
	return privacy.Denyf(format, a...)
}

// Skipf returns a formatted wrapped Skip decision.
func Skipf(format string, a ...any) error {
	return privacy.Skipf(format, a...)
}

// DecisionContext creates a new context from the given parent context with
// a policy decision attach to it.
func DecisionContext(parent context.Context, decision error) context.Context {
	return privacy.DecisionContext(parent, decision)
}

// DecisionFromContext retrieves the policy decision from the context.
func DecisionFromContext(ctx context.Context) (error, bool) {
	return privacy.DecisionFromContext(ctx)
}

type (
	// Policy groups query and mutation policies.
	Policy = privacy.Policy

	// QueryRule defines the interface deciding whether a
	// query is allowed and optionally modify it.
	QueryRule = privacy.QueryRule
	// QueryPolicy combines multiple query rules into a single policy.
	QueryPolicy = privacy.QueryPolicy

	// MutationRule defines the interface which decides whether a
	// mutation is allowed and optionally modifies it.
	MutationRule = privacy.MutationRule
	// MutationPolicy combines multiple mutation rules into a single policy.
	MutationPolicy = privacy.MutationPolicy
	// MutationRuleFunc type is an adapter which allows the use of
	// ordinary functions as mutation rules.
	MutationRuleFunc = privacy.MutationRuleFunc

	// QueryMutationRule is an interface which groups query and mutation rules.
	QueryMutationRule = privacy.QueryMutationRule
)

// QueryRuleFunc type is an adapter to allow the use of
// ordinary functions as query rules.
type QueryRuleFunc func(context.Context, ent.Query) error

// Eval returns f(ctx, q).
func (f QueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	return f(ctx, q)
}

// AlwaysAllowRule returns a rule that returns an allow decision.
func AlwaysAllowRule() QueryMutationRule {
	return privacy.AlwaysAllowRule()
}

// AlwaysDenyRule returns a rule that returns a deny decision.
func AlwaysDenyRule() QueryMutationRule {
	return privacy.AlwaysDenyRule()
}

// ContextQueryMutationRule creates a query/mutation rule from a context eval func.
func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule {
	return privacy.ContextQueryMutationRule(eval)
}

// OnMutationOperation evaluates the given rule only on a given mutation operation.
func OnMutationOperation(rule MutationRule, op ent.Op) MutationRule {
	return privacy.OnMutationOperation(rule, op)
}

// DenyMutationOperationRule returns a rule denying specified mutation operation.
func DenyMutationOperationRule(op ent.Op) MutationRule {
	rule := MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
		return Denyf("ent/privacy: operation %s is not allowed", m.Op())
	})
	return OnMutationOperation(rule, op)
}

// The AlbumQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type AlbumQueryRuleFunc func(context.Context, *ent.AlbumQuery) error

// EvalQuery return f(ctx, q).
func (f AlbumQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.AlbumQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.AlbumQuery", q)
}

// The AlbumMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type AlbumMutationRuleFunc func(context.Context, *ent.AlbumMutation) error

// EvalMutation calls f(ctx, m).
func (f AlbumMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.AlbumMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.AlbumMutation", m)
}

// The ArticleQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type ArticleQueryRuleFunc func(context.Context, *ent.ArticleQuery) error

// EvalQuery return f(ctx, q).
func (f ArticleQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.ArticleQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.ArticleQuery", q)
}

// The ArticleMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type ArticleMutationRuleFunc func(context.Context, *ent.ArticleMutation) error

// EvalMutation calls f(ctx, m).
func (f ArticleMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.ArticleMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.ArticleMutation", m)
}

// The CommentQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type CommentQueryRuleFunc func(context.Context, *ent.CommentQuery) error

// EvalQuery return f(ctx, q).
func (f CommentQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.CommentQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.CommentQuery", q)
}

// The CommentMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type CommentMutationRuleFunc func(context.Context, *ent.CommentMutation) error

// EvalMutation calls f(ctx, m).
func (f CommentMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.CommentMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.CommentMutation", m)
}

// The DirectLinkQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type DirectLinkQueryRuleFunc func(context.Context, *ent.DirectLinkQuery) error

// EvalQuery return f(ctx, q).
func (f DirectLinkQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.DirectLinkQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.DirectLinkQuery", q)
}

// The DirectLinkMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type DirectLinkMutationRuleFunc func(context.Context, *ent.DirectLinkMutation) error

// EvalMutation calls f(ctx, m).
func (f DirectLinkMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.DirectLinkMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.DirectLinkMutation", m)
}

// The EntityQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type EntityQueryRuleFunc func(context.Context, *ent.EntityQuery) error

// EvalQuery return f(ctx, q).
func (f EntityQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.EntityQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.EntityQuery", q)
}

// The EntityMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type EntityMutationRuleFunc func(context.Context, *ent.EntityMutation) error

// EvalMutation calls f(ctx, m).
func (f EntityMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.EntityMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.EntityMutation", m)
}

// The FileQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type FileQueryRuleFunc func(context.Context, *ent.FileQuery) error

// EvalQuery return f(ctx, q).
func (f FileQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.FileQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.FileQuery", q)
}

// The FileMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type FileMutationRuleFunc func(context.Context, *ent.FileMutation) error

// EvalMutation calls f(ctx, m).
func (f FileMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.FileMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.FileMutation", m)
}

// The FileEntityQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type FileEntityQueryRuleFunc func(context.Context, *ent.FileEntityQuery) error

// EvalQuery return f(ctx, q).
func (f FileEntityQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.FileEntityQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.FileEntityQuery", q)
}

// The FileEntityMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type FileEntityMutationRuleFunc func(context.Context, *ent.FileEntityMutation) error

// EvalMutation calls f(ctx, m).
func (f FileEntityMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.FileEntityMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.FileEntityMutation", m)
}

// The LinkQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type LinkQueryRuleFunc func(context.Context, *ent.LinkQuery) error

// EvalQuery return f(ctx, q).
func (f LinkQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.LinkQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.LinkQuery", q)
}

// The LinkMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type LinkMutationRuleFunc func(context.Context, *ent.LinkMutation) error

// EvalMutation calls f(ctx, m).
func (f LinkMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.LinkMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.LinkMutation", m)
}

// The LinkCategoryQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type LinkCategoryQueryRuleFunc func(context.Context, *ent.LinkCategoryQuery) error

// EvalQuery return f(ctx, q).
func (f LinkCategoryQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.LinkCategoryQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.LinkCategoryQuery", q)
}

// The LinkCategoryMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type LinkCategoryMutationRuleFunc func(context.Context, *ent.LinkCategoryMutation) error

// EvalMutation calls f(ctx, m).
func (f LinkCategoryMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.LinkCategoryMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.LinkCategoryMutation", m)
}

// The LinkTagQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type LinkTagQueryRuleFunc func(context.Context, *ent.LinkTagQuery) error

// EvalQuery return f(ctx, q).
func (f LinkTagQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.LinkTagQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.LinkTagQuery", q)
}

// The LinkTagMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type LinkTagMutationRuleFunc func(context.Context, *ent.LinkTagMutation) error

// EvalMutation calls f(ctx, m).
func (f LinkTagMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.LinkTagMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.LinkTagMutation", m)
}

// The MetadataQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type MetadataQueryRuleFunc func(context.Context, *ent.MetadataQuery) error

// EvalQuery return f(ctx, q).
func (f MetadataQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.MetadataQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.MetadataQuery", q)
}

// The MetadataMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type MetadataMutationRuleFunc func(context.Context, *ent.MetadataMutation) error

// EvalMutation calls f(ctx, m).
func (f MetadataMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.MetadataMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.MetadataMutation", m)
}

// The PageQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type PageQueryRuleFunc func(context.Context, *ent.PageQuery) error

// EvalQuery return f(ctx, q).
func (f PageQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.PageQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.PageQuery", q)
}

// The PageMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type PageMutationRuleFunc func(context.Context, *ent.PageMutation) error

// EvalMutation calls f(ctx, m).
func (f PageMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.PageMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.PageMutation", m)
}

// The PostCategoryQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type PostCategoryQueryRuleFunc func(context.Context, *ent.PostCategoryQuery) error

// EvalQuery return f(ctx, q).
func (f PostCategoryQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.PostCategoryQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.PostCategoryQuery", q)
}

// The PostCategoryMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type PostCategoryMutationRuleFunc func(context.Context, *ent.PostCategoryMutation) error

// EvalMutation calls f(ctx, m).
func (f PostCategoryMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.PostCategoryMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.PostCategoryMutation", m)
}

// The PostTagQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type PostTagQueryRuleFunc func(context.Context, *ent.PostTagQuery) error

// EvalQuery return f(ctx, q).
func (f PostTagQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.PostTagQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.PostTagQuery", q)
}

// The PostTagMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type PostTagMutationRuleFunc func(context.Context, *ent.PostTagMutation) error

// EvalMutation calls f(ctx, m).
func (f PostTagMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.PostTagMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.PostTagMutation", m)
}

// The SettingQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type SettingQueryRuleFunc func(context.Context, *ent.SettingQuery) error

// EvalQuery return f(ctx, q).
func (f SettingQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.SettingQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.SettingQuery", q)
}

// The SettingMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type SettingMutationRuleFunc func(context.Context, *ent.SettingMutation) error

// EvalMutation calls f(ctx, m).
func (f SettingMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.SettingMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.SettingMutation", m)
}

// The StoragePolicyQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type StoragePolicyQueryRuleFunc func(context.Context, *ent.StoragePolicyQuery) error

// EvalQuery return f(ctx, q).
func (f StoragePolicyQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.StoragePolicyQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.StoragePolicyQuery", q)
}

// The StoragePolicyMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type StoragePolicyMutationRuleFunc func(context.Context, *ent.StoragePolicyMutation) error

// EvalMutation calls f(ctx, m).
func (f StoragePolicyMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.StoragePolicyMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.StoragePolicyMutation", m)
}

// The TagQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type TagQueryRuleFunc func(context.Context, *ent.TagQuery) error

// EvalQuery return f(ctx, q).
func (f TagQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.TagQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.TagQuery", q)
}

// The TagMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type TagMutationRuleFunc func(context.Context, *ent.TagMutation) error

// EvalMutation calls f(ctx, m).
func (f TagMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.TagMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.TagMutation", m)
}

// The URLStatQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type URLStatQueryRuleFunc func(context.Context, *ent.URLStatQuery) error

// EvalQuery return f(ctx, q).
func (f URLStatQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.URLStatQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.URLStatQuery", q)
}

// The URLStatMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type URLStatMutationRuleFunc func(context.Context, *ent.URLStatMutation) error

// EvalMutation calls f(ctx, m).
func (f URLStatMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.URLStatMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.URLStatMutation", m)
}

// The UserQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type UserQueryRuleFunc func(context.Context, *ent.UserQuery) error

// EvalQuery return f(ctx, q).
func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.UserQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.UserQuery", q)
}

// The UserMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type UserMutationRuleFunc func(context.Context, *ent.UserMutation) error

// EvalMutation calls f(ctx, m).
func (f UserMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.UserMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.UserMutation", m)
}

// The UserGroupQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type UserGroupQueryRuleFunc func(context.Context, *ent.UserGroupQuery) error

// EvalQuery return f(ctx, q).
func (f UserGroupQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.UserGroupQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.UserGroupQuery", q)
}

// The UserGroupMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type UserGroupMutationRuleFunc func(context.Context, *ent.UserGroupMutation) error

// EvalMutation calls f(ctx, m).
func (f UserGroupMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.UserGroupMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.UserGroupMutation", m)
}

// The UserInstalledThemeQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type UserInstalledThemeQueryRuleFunc func(context.Context, *ent.UserInstalledThemeQuery) error

// EvalQuery return f(ctx, q).
func (f UserInstalledThemeQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.UserInstalledThemeQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.UserInstalledThemeQuery", q)
}

// The UserInstalledThemeMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type UserInstalledThemeMutationRuleFunc func(context.Context, *ent.UserInstalledThemeMutation) error

// EvalMutation calls f(ctx, m).
func (f UserInstalledThemeMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.UserInstalledThemeMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.UserInstalledThemeMutation", m)
}

// The VisitorLogQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type VisitorLogQueryRuleFunc func(context.Context, *ent.VisitorLogQuery) error

// EvalQuery return f(ctx, q).
func (f VisitorLogQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.VisitorLogQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.VisitorLogQuery", q)
}

// The VisitorLogMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type VisitorLogMutationRuleFunc func(context.Context, *ent.VisitorLogMutation) error

// EvalMutation calls f(ctx, m).
func (f VisitorLogMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.VisitorLogMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.VisitorLogMutation", m)
}

// The VisitorStatQueryRuleFunc type is an adapter to allow the use of ordinary
// functions as a query rule.
type VisitorStatQueryRuleFunc func(context.Context, *ent.VisitorStatQuery) error

// EvalQuery return f(ctx, q).
func (f VisitorStatQueryRuleFunc) EvalQuery(ctx context.Context, q ent.Query) error {
	if q, ok := q.(*ent.VisitorStatQuery); ok {
		return f(ctx, q)
	}
	return Denyf("ent/privacy: unexpected query type %T, expect *ent.VisitorStatQuery", q)
}

// The VisitorStatMutationRuleFunc type is an adapter to allow the use of ordinary
// functions as a mutation rule.
type VisitorStatMutationRuleFunc func(context.Context, *ent.VisitorStatMutation) error

// EvalMutation calls f(ctx, m).
func (f VisitorStatMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error {
	if m, ok := m.(*ent.VisitorStatMutation); ok {
		return f(ctx, m)
	}
	return Denyf("ent/privacy: unexpected mutation type %T, expect *ent.VisitorStatMutation", m)
}
