pub struct Role { /* private fields */ }Expand description
A set of permissions a person can have.
Implementations§
Source§impl Role
impl Role
Sourcepub fn policy(self, policy: PermissionPolicy) -> Self
pub fn policy(self, policy: PermissionPolicy) -> Self
What it says about what no permission mentions.
Sourcepub fn administrative(self) -> Self
pub fn administrative(self) -> Self
It can do everything, and no permission takes anything away from it.
Sourcepub fn is_administrative(&self) -> bool
pub fn is_administrative(&self) -> bool
Whether it can do everything.
Sourcepub fn can_edit_model(self) -> Self
pub fn can_edit_model(self) -> Self
It can change the application’s model while it runs.
Sourcepub fn type_permission(
self,
entity: impl Into<String>,
operations: impl IntoIterator<Item = Operation>,
access: Access,
) -> Self
pub fn type_permission( self, entity: impl Into<String>, operations: impl IntoIterator<Item = Operation>, access: Access, ) -> Self
Says this about these operations on every record of an entity.
Sourcepub fn object_permission(
self,
entity: impl Into<String>,
criteria: &str,
operations: impl IntoIterator<Item = Operation>,
access: Access,
) -> Self
pub fn object_permission( self, entity: impl Into<String>, criteria: &str, operations: impl IntoIterator<Item = Operation>, access: Access, ) -> Self
Says this about these operations on the records an expression holds for. ?CurrentUserId
and ?CurrentUserName are the person. It comes before what is said about the whole entity.
Sourcepub fn member_permission(
self,
entity: impl Into<String>,
fields: impl IntoIterator<Item = impl Into<String>>,
criteria: Option<&str>,
operations: impl IntoIterator<Item = Operation>,
access: Access,
) -> Self
pub fn member_permission( self, entity: impl Into<String>, fields: impl IntoIterator<Item = impl Into<String>>, criteria: Option<&str>, operations: impl IntoIterator<Item = Operation>, access: Access, ) -> Self
Says this about reading or writing these fields, on every record or, with an expression, on those it holds for. It comes before everything else, the expression first.
Whether this navigation item or group shows, by its id. An item comes before its group. It only hides: what protects records are the other permissions.
Sourcepub fn action_permission(
self,
action: impl Into<String>,
access: Access,
) -> Self
pub fn action_permission( self, action: impl Into<String>, access: Access, ) -> Self
Whether this action exists for it, by its id. A denied one goes away, whatever else says.