pub struct Authorization { /* private fields */ }
Implementations§
Source§impl Authorization
impl Authorization
pub fn load(res_perm_file: &str, user_role_file: &str) -> Authorization
pub fn has_permissions_for(&self, cid: &str) -> bool
pub fn set_permissions_for(&mut self, cid: &str)
pub fn allows_add(&self, cid: &str, res: &str, data: &Map<String, Json>) -> bool
pub fn allows_view( &self, cid: &str, res: &str, data: &Map<String, Json>, ) -> bool
pub fn allows_edit( &self, cid: &str, res: &str, data: &Map<String, Json>, ) -> bool
pub fn allows_delete( &self, cid: &str, res: &str, data: &Map<String, Json>, ) -> bool
Trait Implementations§
Source§impl Clone for Authorization
impl Clone for Authorization
Source§fn clone(&self) -> Authorization
fn clone(&self) -> Authorization
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Authorization
impl Debug for Authorization
Source§impl<'de> Deserialize<'de> for Authorization
impl<'de> Deserialize<'de> for Authorization
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Authorization
impl RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl UnwindSafe for Authorization
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