Skip to main content

Module permission

Module permission 

Source
Expand description

Permission-policy helpers that produce a handler::PermissionHandler. Permission policy primitives that produce a PermissionHandler.

Compose these into a session via the builder methods SessionConfig::approve_all_permissions, deny_all_permissions, and approve_permissions_if. The same primitives are also available as standalone functions that return an Arc<dyn PermissionHandler> you can install via SessionConfig::with_permission_handler.

For a one-shot approve / deny without composition, see ApproveAllHandler and DenyAllHandler.

Functionsยง

approve_all
Return a PermissionHandler that approves every request.
approve_if
Return a PermissionHandler that consults a predicate for each request. true approves, false denies.
deny_all
Return a PermissionHandler that denies every request.