Trait bonsaidb::core::connection::HasSession[][src]

pub trait HasSession {
    fn session(&self) -> Option<&Session>;

    fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> bool
    where
        R: AsRef<[Identifier<'a>]>,
        P: Action
, { ... }
fn check_permission<'a, R, P>(
        &self,
        resource_name: R,
        action: &P
    ) -> Result<(), Error>
    where
        R: AsRef<[Identifier<'a>]>,
        P: Action
, { ... } }
Expand description

Functions to access information about the current session (authentication).

Required methods

Returns the currently authenticated session, if any.

Provided methods

Checks if action is permitted against resource_name.

Checks if action is permitted against resource_name. If permission is denied, returns a PermissionDenied error.

Implementors