Skip to main content

check_perm_create

Function check_perm_create 

Source
pub fn check_perm_create(
    resource_type: &'static str,
    action: &'static str,
) -> impl Fn(State<App>, Auth, Request, Next) -> PermissionCheckOutput + Clone
Expand description

Middleware factory for collection permission checks

Returns a middleware function that validates CREATE permissions via ABAC. Evaluates collection-level policies based on subject attributes.

§Arguments

  • resource_type - The resource being created (e.g., “file”, “action”)
  • action - The permission action to check (e.g., “create”)

§Returns

A cloneable middleware function with return type PermissionCheckOutput