pub struct Gate<Pp, Codec>where
Codec: CodecService,
Pp: Passport,{ /* private fields */ }
Expand description
The gate is protecting your application from unauthorized access.
Implementations§
Source§impl<Pp, Codec> Gate<Pp, Codec>where
Codec: CodecService,
Pp: Passport,
impl<Pp, Codec> Gate<Pp, Codec>where
Codec: CodecService,
Pp: Passport,
Adds the cookie builder as a template for the cookie used for auth.
Sourcepub fn grant_role(self, role: Pp::Role) -> Self
pub fn grant_role(self, role: Pp::Role) -> Self
Users with the given role are granted access.
Sourcepub fn grant_role_and_supervisor(self, role: Pp::Role) -> Self
pub fn grant_role_and_supervisor(self, role: Pp::Role) -> Self
Users with the given role and all supervisor roles are granted access.
Sourcepub fn grant_group(self, group: Pp::Group) -> Self
pub fn grant_group(self, group: Pp::Group) -> Self
Users that are member of the given groupe are granted access.
Trait Implementations§
Auto Trait Implementations§
impl<Pp, Codec> Freeze for Gate<Pp, Codec>
impl<Pp, Codec> RefUnwindSafe for Gate<Pp, Codec>where
<Pp as Passport>::Group: RefUnwindSafe,
Codec: RefUnwindSafe,
<Pp as Passport>::Role: RefUnwindSafe,
impl<Pp, Codec> Send for Gate<Pp, Codec>
impl<Pp, Codec> Sync for Gate<Pp, Codec>
impl<Pp, Codec> Unpin for Gate<Pp, Codec>
impl<Pp, Codec> UnwindSafe for Gate<Pp, Codec>where
Codec: RefUnwindSafe,
<Pp as Passport>::Group: UnwindSafe,
<Pp as Passport>::Role: UnwindSafe,
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