Skip to main content

ScopeProvider

Trait ScopeProvider 

Source
pub trait ScopeProvider<C, E: SearchEntity>: Send + Sync {
    // Required method
    fn scope(&self, context: &C) -> Result<ServerScope<E>, ParamError>;
}
Expand description

Builds a server-owned authorization scope from a trusted request context.

The context is supplied by the application after authentication. It is never parsed from RawParams, and the resulting scope is still validated by the normal query planner before any SQL is rendered.

Required Methods§

Source

fn scope(&self, context: &C) -> Result<ServerScope<E>, ParamError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C, E, F> ScopeProvider<C, E> for F
where E: SearchEntity, F: Fn(&C) -> Result<ServerScope<E>, ParamError> + Send + Sync,