policy

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCreateAccess

func CheckCreateAccess() privacy.MutationRule

CheckCreateAccess checks if the user has access to create an object in the org for create operations

func CheckOrgReadAccess

func CheckOrgReadAccess() privacy.QueryRule

CheckOrgReadAccess checks if the requestor has access to read the organization

func CheckOrgWriteAccess

func CheckOrgWriteAccess() privacy.MutationRule

CheckOrgWriteAccess checks if the requestor has access to edit the organization

func DenyMutationIfNotAuthenticated

func DenyMutationIfNotAuthenticated() privacy.MutationRule

DenyMutationIfNotAuthenticated denies a mutation if the user is not authenticated

func DenyQueryIfNotAuthenticated

func DenyQueryIfNotAuthenticated() privacy.QueryRule

DenyQueryIfNotAuthenticated denies a query if the user is not authenticated

func NewPolicy

func NewPolicy(opts ...PolicyOption) ent.Policy

NewPolicy creates a privacy policy.

Types

type PolicyOption

type PolicyOption func(*policies)

PolicyOption configures policy creation.

func WithMutationRules

func WithMutationRules(rules ...privacy.MutationRule) PolicyOption

WithMutationRules adds mutation rules to policy.

func WithOnMutationRules

func WithOnMutationRules(op ent.Op, rules ...privacy.MutationRule) PolicyOption

WithOnQueryRules adds query rules to policy for specific operations.

func WithPostPolicy

func WithPostPolicy(policy privacy.Policy) PolicyOption

WithPostPolicy overrides the post-policy to be executed.

func WithPrePolicy

func WithPrePolicy(policy privacy.Policy) PolicyOption

WithPrePolicy overrides the pre-policy to be executed.

func WithQueryRules

func WithQueryRules(rules ...privacy.QueryRule) PolicyOption

WithQueryRules adds query rules to policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL