pub trait HasRole<R, P>{
// Required methods
fn has_role(&self, r: &R, p: &P) -> bool;
fn has_role_object(&self, role: &Role<R, P>) -> bool;
}Expand description
Trait for role-based access control.
Implement this trait to check if a user has a specific role with a permission scope.
Required Methods§
Sourcefn has_role(&self, r: &R, p: &P) -> bool
fn has_role(&self, r: &R, p: &P) -> bool
Checks if the user has the given role with the given permission.
Sourcefn has_role_object(&self, role: &Role<R, P>) -> bool
fn has_role_object(&self, role: &Role<R, P>) -> bool
Checks if the user has the given role object.