Documentation ¶
Index ¶
- func CheckCreateAccess() privacy.MutationRule
- func CheckOrgReadAccess() privacy.QueryRule
- func CheckOrgWriteAccess() privacy.MutationRule
- func DenyMutationIfNotAuthenticated() privacy.MutationRule
- func DenyQueryIfNotAuthenticated() privacy.QueryRule
- func NewPolicy(opts ...PolicyOption) ent.Policy
- type PolicyOption
- func WithMutationRules(rules ...privacy.MutationRule) PolicyOption
- func WithOnMutationRules(op ent.Op, rules ...privacy.MutationRule) PolicyOption
- func WithPostPolicy(policy privacy.Policy) PolicyOption
- func WithPrePolicy(policy privacy.Policy) PolicyOption
- func WithQueryRules(rules ...privacy.QueryRule) PolicyOption
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 ¶
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 ¶
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.