pub struct PermissionSet {
pub databases: Vec<String>,
pub schemas: Vec<String>,
pub tables: Vec<String>,
pub operations: Vec<Operation>,
pub row_predicates: HashMap<String, String>,
pub column_restrictions: HashMap<String, Vec<String>>,
}Expand description
Permission set for authorization
Fields§
§databases: Vec<String>Allowed databases
schemas: Vec<String>Allowed schemas
tables: Vec<String>Allowed tables (database.schema.table patterns)
operations: Vec<Operation>Allowed operations
row_predicates: HashMap<String, String>Row-level security predicates
column_restrictions: HashMap<String, Vec<String>>Column restrictions
Implementations§
Source§impl PermissionSet
impl PermissionSet
Sourcepub fn full_access() -> Self
pub fn full_access() -> Self
Create a full access permission set
Sourcepub fn is_operation_allowed(&self, operation: &Operation, table: &str) -> bool
pub fn is_operation_allowed(&self, operation: &Operation, table: &str) -> bool
Check if operation is allowed on table
Sourcepub fn row_predicate(&self, table: &str) -> Option<&String>
pub fn row_predicate(&self, table: &str) -> Option<&String>
Get row predicate for a table
Trait Implementations§
Source§impl Clone for PermissionSet
impl Clone for PermissionSet
Source§fn clone(&self) -> PermissionSet
fn clone(&self) -> PermissionSet
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 moreAuto Trait Implementations§
impl Freeze for PermissionSet
impl RefUnwindSafe for PermissionSet
impl Send for PermissionSet
impl Sync for PermissionSet
impl Unpin for PermissionSet
impl UnsafeUnpin for PermissionSet
impl UnwindSafe for PermissionSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more