mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen/privacy: rename DenyMutationOperation -> DenyMutationOperationRule
Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -140,8 +140,8 @@ type fixedDecisionRule struct { err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, {{ $pkg }}.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, {{ $pkg }}.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op {{ $pkg }}.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op {{ $pkg }}.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m {{ $pkg }}.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, entv1.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, entv1.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op entv1.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op entv1.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m entv1.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, entv2.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, entv2.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op entv2.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op entv2.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m entv2.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
@@ -148,8 +148,8 @@ type fixedDecisionRule struct{ err error }
|
||||
func (f fixedDecisionRule) EvalQuery(context.Context, ent.Query) error { return f.err }
|
||||
func (f fixedDecisionRule) EvalMutation(context.Context, ent.Mutation) error { return f.err }
|
||||
|
||||
// DenyMutationOperation returns a rule denying specifies mutation operation.
|
||||
func DenyMutationOperation(op ent.Op) MutationRule {
|
||||
// DenyMutationOperationRule returns a rule denying specified mutation operation.
|
||||
func DenyMutationOperationRule(op ent.Op) MutationRule {
|
||||
return MutationRuleFunc(func(_ context.Context, m ent.Mutation) error {
|
||||
if m.Op().Is(op) {
|
||||
return Denyf("ent/privacy: operation %s is not allowed", m.Op())
|
||||
|
||||
Reference in New Issue
Block a user