pub struct Permissions { /* private fields */ }Expand description
What one person can do: the answers of their roles, brought together.
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub fn new(
identity: Identity,
entities: Vec<EntityInfo>,
merge: RoleMerge,
) -> Self
pub fn new( identity: Identity, entities: Vec<EntityInfo>, merge: RoleMerge, ) -> Self
What this person can do over these entities.
Sourcepub fn environment(&self) -> &Environment
pub fn environment(&self) -> &Environment
What expressions about this person are evaluated with.
Sourcepub fn is_administrator(&self) -> bool
pub fn is_administrator(&self) -> bool
Whether they can do everything.
Sourcepub fn can_edit_model(&self) -> bool
pub fn can_edit_model(&self) -> bool
Whether they can change the application’s model while it runs.
Sourcepub fn can(
&self,
operation: Operation,
entity: &str,
record: Option<&Object>,
) -> bool
pub fn can( &self, operation: Operation, entity: &str, record: Option<&Object>, ) -> bool
Whether they can do this to this record or, with none, to some record of the entity.
Sourcepub fn can_field(
&self,
operation: Operation,
entity: &str,
field: &str,
record: Option<&Object>,
) -> bool
pub fn can_field( &self, operation: Operation, entity: &str, field: &str, record: Option<&Object>, ) -> bool
Whether they can read or write this field of this record or, with none, of some record.
Whether this navigation item shows, inside this group, if it has one. An item comes before its group, and what no role mentions shows.
Sourcepub fn can_use_action(&self, action: &str) -> bool
pub fn can_use_action(&self, action: &str) -> bool
Whether this action exists for them. Any role that denies it takes it away.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Permissions
impl !RefUnwindSafe for Permissions
impl !Send for Permissions
impl !Sync for Permissions
impl !UnwindSafe for Permissions
impl Unpin for Permissions
impl UnsafeUnpin for Permissions
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