pub struct AccessSpec {
pub public: bool,
pub authenticated: bool,
pub roles: Vec<String>,
pub permissions: Vec<String>,
pub can: Option<CanSpec>,
}Expand description
Who may call a route. A route must declare at least one of these.
Fields§
§public: boolNo authentication or authorization.
authenticated: boolAny signed-in user.
roles: Vec<String>Any of these roles.
permissions: Vec<String>All of these permissions.
can: Option<CanSpec>An ability check.
Implementations§
Source§impl AccessSpec
impl AccessSpec
Sourcepub fn is_declared(&self) -> bool
pub fn is_declared(&self) -> bool
Whether the route declares its access at all (deny by default).
Whether the route declares roles, permissions or an ability, which the
RouteAuthorizer checks.
Trait Implementations§
Source§impl Clone for AccessSpec
impl Clone for AccessSpec
Source§impl Debug for AccessSpec
impl Debug for AccessSpec
Auto Trait Implementations§
impl Forget for AccessSpec
impl Freeze for AccessSpec
impl Move for AccessSpec
impl RefUnwindSafe for AccessSpec
impl Send for AccessSpec
impl Sync for AccessSpec
impl Unpin for AccessSpec
impl UnsafeUnpin for AccessSpec
impl UnwindSafe for AccessSpec
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