Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatedByUpdatedByHook ¶
CreatedByUpdatedByHook automatically sets created_by and updated_by fields
func EntityMutatePermission ¶
EntityMutatePermission checks if the current user has permission to perform mutation operations This hook is applied to external API requests (GraphQL/REST) where isInternalOperationContextValue is not set
func EntityReadPermission ¶
func EntityReadPermission() ent.Interceptor
EntityReadPermission creates an interceptor for read operations This interceptor is applied to external API requests (GraphQL/REST) where isInternalOperationContextValue is not set
Types ¶
type LifecycleFilterMutation ¶ added in v0.1.9
type LifecycleFilterMutation interface {
WhereEntityStateIn(states ...entity.EntityState)
}
LifecycleFilterMutation is an interface for mutations that support restricting by entity_state. The WhereEntityStateIn method is generated for entities with lifecycle enabled (UpdateMany/DeleteMany).
type LifecycleFilterQuery ¶ added in v0.1.9
type LifecycleFilterQuery interface {
ent.Query
WhereEntityStateIn(states ...entity.EntityState) ent.Query
}
LifecycleFilterQuery is an interface for queries that support filtering by entity_state. The WhereEntityStateIn method is generated for entities with lifecycle enabled.
type LifecycleMutationTargetsChecker ¶ added in v0.1.9
type LifecycleMutationTargetsChecker interface {
TargetsAllowedByLifecycle(ctx context.Context) (*entity.EntityState, error)
}
LifecycleMutationTargetsChecker is implemented by lifecycle-entity mutations for UpdateOne/DeleteOne. permissionLifecycleAccess is one slice of allowed states per permission; empty slice means full access.