pub struct IdentityPerms {
pub admin: bool,
pub manage_acl: bool,
pub migrate: bool,
pub all_tables: TablePerms,
pub per_table: Vec<(u64, TablePerms)>,
}Expand description
Effective permission set carried by a single identity.
per_table is encoded as a Vec<(TableFingerprint, TablePerms)> so
the type maps cleanly onto Candid (no HashMap on the wire). Lookup
happens via linear scan; the table count is bounded by the schema.
Fields§
§admin: boolBypass all table checks. Does NOT imply manage_acl or migrate.
manage_acl: boolPermission to grant/revoke perms and add/remove identities.
migrate: boolPermission to run Dbms::migrate().
all_tables: TablePermsTable perms applied to every table. Unioned with per_table.
per_table: Vec<(u64, TablePerms)>Per-table perms. Additive over all_tables.
Implementations§
Source§impl IdentityPerms
impl IdentityPerms
Sourcepub fn fully_permissive() -> IdentityPerms
pub fn fully_permissive() -> IdentityPerms
Fully-permissive perms, used by NoAccessControl.
Sourcepub fn grants_table(&self, table: u64, required: TablePerms) -> bool
pub fn grants_table(&self, table: u64, required: TablePerms) -> bool
Returns whether this identity is granted required on table.
Sourcepub fn apply_grant(&mut self, grant: PermGrant)
pub fn apply_grant(&mut self, grant: PermGrant)
Applies grant in place. Idempotent.
Sourcepub fn apply_revoke(&mut self, revoke: PermRevoke)
pub fn apply_revoke(&mut self, revoke: PermRevoke)
Applies revoke in place. Idempotent. Removes empty per-table entries.
Trait Implementations§
Source§impl CandidType for IdentityPerms
impl CandidType for IdentityPerms
Source§impl Clone for IdentityPerms
impl Clone for IdentityPerms
Source§fn clone(&self) -> IdentityPerms
fn clone(&self) -> IdentityPerms
Returns a duplicate 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 IdentityPerms
impl Debug for IdentityPerms
Source§impl Default for IdentityPerms
impl Default for IdentityPerms
Source§fn default() -> IdentityPerms
fn default() -> IdentityPerms
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for IdentityPerms
impl<'de> Deserialize<'de> for IdentityPerms
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IdentityPerms, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IdentityPerms, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for IdentityPerms
impl PartialEq for IdentityPerms
Source§impl Serialize for IdentityPerms
impl Serialize for IdentityPerms
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for IdentityPerms
impl StructuralPartialEq for IdentityPerms
Auto Trait Implementations§
impl Freeze for IdentityPerms
impl RefUnwindSafe for IdentityPerms
impl Send for IdentityPerms
impl Sync for IdentityPerms
impl Unpin for IdentityPerms
impl UnsafeUnpin for IdentityPerms
impl UnwindSafe for IdentityPerms
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