Struct grant::config::role::RoleTableLevel
source · pub struct RoleTableLevel {
pub name: String,
pub grants: Vec<String>,
pub schemas: Vec<String>,
pub tables: Vec<String>,
}
Expand description
Role Table Level.
For example:
- name: role_table
grants:
- SELECT
- INSERT
- UPDATE
- DELETE
schemas:
- public
tables:
- ALL
- +table1
- -table2
- -public.table2
The above example grants SELECT, INSERT, UPDATE, DELETE to all tables in the public schema except table2. The ALL is a special keyword that means all tables in the public schema. If the table does not have a schema, it is assumed to be in all schema.
Fields§
§name: String
§grants: Vec<String>
§schemas: Vec<String>
§tables: Vec<String>
Implementations§
source§impl RoleTableLevel
impl RoleTableLevel
sourcepub fn to_sql(&self, user: &str) -> String
pub fn to_sql(&self, user: &str) -> String
Generate role table to sql.
{GRANT | REVOKE} { { SELECT | INSERT | UPDATE | DELETE | DROP | REFERENCES } [,...] | ALL [ PRIVILEGES ] }
ON { [ TABLE ] table_name [, ...] | ALL TABLES IN SCHEMA schema_name [, ...] }
TO { username [ WITH GRANT OPTION ] | GROUP group_name | PUBLIC } [, ...]
Trait Implementations§
source§impl Clone for RoleTableLevel
impl Clone for RoleTableLevel
source§fn clone(&self) -> RoleTableLevel
fn clone(&self) -> RoleTableLevel
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 RoleTableLevel
impl Debug for RoleTableLevel
source§impl<'de> Deserialize<'de> for RoleTableLevel
impl<'de> Deserialize<'de> for RoleTableLevel
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
source§impl PartialEq for RoleTableLevel
impl PartialEq for RoleTableLevel
source§fn eq(&self, other: &RoleTableLevel) -> bool
fn eq(&self, other: &RoleTableLevel) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RoleValidate for RoleTableLevel
impl RoleValidate for RoleTableLevel
source§impl Serialize for RoleTableLevel
impl Serialize for RoleTableLevel
impl Eq for RoleTableLevel
impl StructuralPartialEq for RoleTableLevel
Auto Trait Implementations§
impl Freeze for RoleTableLevel
impl RefUnwindSafe for RoleTableLevel
impl Send for RoleTableLevel
impl Sync for RoleTableLevel
impl Unpin for RoleTableLevel
impl UnwindSafe for RoleTableLevel
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.