pub struct RoleRequirementsGuard { /* private fields */ }Expand description
This is the crate users will import. It re-exports the internal pieces use nestforge::{NestForgeFactory, ModuleDefinition, Container}; A built-in guard that checks if the authenticated user has specific roles.
It requires authentication first, then checks ctx.has_role(role).
Implementations§
Source§impl RoleRequirementsGuard
impl RoleRequirementsGuard
pub fn new<I, S>(roles: I) -> RoleRequirementsGuard
Trait Implementations§
Source§impl Guard for RoleRequirementsGuard
impl Guard for RoleRequirementsGuard
fn can_activate(&self, ctx: &RequestContext) -> Result<(), HttpException>
Auto Trait Implementations§
impl Freeze for RoleRequirementsGuard
impl RefUnwindSafe for RoleRequirementsGuard
impl Send for RoleRequirementsGuard
impl Sync for RoleRequirementsGuard
impl Unpin for RoleRequirementsGuard
impl UnsafeUnpin for RoleRequirementsGuard
impl UnwindSafe for RoleRequirementsGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more