[][src]Trait qonfucius_sso_utility::AuthorizeScope

pub trait AuthorizeScope<T> {
    type ScopedResource;
    type Action;
    pub fn is_authorized(
        &self,
        authorized_scopes: Scope<Self::ScopedResource>,
        action: &Self::Action,
        target: Option<&T>
    ) -> bool
    where
        Self::ScopedResource: Hash + Eq + Debug + Clone
; pub fn authorize_action(
        &self,
        authorized_scopes: Scope<Self::ScopedResource>,
        action: Self::Action,
        target: Option<&T>
    ) -> Result<(), UtilityError>
    where
        Self::ScopedResource: Hash + Eq + Debug + Clone,
        Self::Action: Display
, { ... } }

Utility Trait to handle ACL from a type to an other through a custom Scope

Associated Types

type ScopedResource[src]

Your custom scoped resource type

type Action[src]

Your custom action type, usally an enum with variants like Write, Access etc.

Loading content...

Required methods

pub fn is_authorized(
    &self,
    authorized_scopes: Scope<Self::ScopedResource>,
    action: &Self::Action,
    target: Option<&T>
) -> bool where
    Self::ScopedResource: Hash + Eq + Debug + Clone
[src]

Is the action authorized for Self on target

Loading content...

Provided methods

pub fn authorize_action(
    &self,
    authorized_scopes: Scope<Self::ScopedResource>,
    action: Self::Action,
    target: Option<&T>
) -> Result<(), UtilityError> where
    Self::ScopedResource: Hash + Eq + Debug + Clone,
    Self::Action: Display
[src]

Authorizes action for Self on target or returns an error.

Loading content...

Implementors

Loading content...