pub struct Permission<T> {
pub selector: T,
pub allow: bool,
}Expand description
Pairs a selector with a permission disposition (allow or deny).
Stored inside AccessControlSelectorSet and evaluated by the policy
resolver. When a Permission ’s selector matches an incoming operation,
its allow flag determines whether the operation is permitted or forbidden.
Fields§
§selector: TThe selector that defines which operations this rule applies to.
allow: booltrue to permit the matched operation, false to deny it.
Implementations§
Source§impl Permission<CreateIndex>
impl Permission<CreateIndex>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
index_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), index_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateIndex selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateTable>
impl Permission<CreateTable>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateTable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateTempIndex>
impl Permission<CreateTempIndex>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
index_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), index_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateTempIndex selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateTempTable>
impl Permission<CreateTempTable>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateTempTable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateTempTrigger>
impl Permission<CreateTempTrigger>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
trigger_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), trigger_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateTempTrigger selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateTempView>
impl Permission<CreateTempView>
Sourcepub fn check(
&self,
view_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, view_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateTempView selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateTrigger>
impl Permission<CreateTrigger>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
trigger_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), trigger_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateTrigger selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateView>
impl Permission<CreateView>
Sourcepub fn check(
&self,
view_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, view_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateView selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Delete>
impl Permission<Delete>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Delete selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropIndex>
impl Permission<DropIndex>
Source§impl Permission<DropTable>
impl Permission<DropTable>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropTable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropTempIndex>
impl Permission<DropTempIndex>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
index_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), index_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropTempIndex selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropTempTable>
impl Permission<DropTempTable>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropTempTable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropTempTrigger>
impl Permission<DropTempTrigger>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
trigger_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), trigger_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropTempTrigger selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropTempView>
impl Permission<DropTempView>
Sourcepub fn check(
&self,
view_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, view_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropTempView selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropTrigger>
impl Permission<DropTrigger>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
trigger_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), trigger_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropTrigger selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropView>
impl Permission<DropView>
Sourcepub fn check(
&self,
view_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, view_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropView selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Insert>
impl Permission<Insert>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Insert selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Pragma>
impl Permission<Pragma>
Sourcepub fn check(
&self,
pragma_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, pragma_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Pragma selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Read>
impl Permission<Read>
Source§impl Permission<Select>
impl Permission<Select>
Sourcepub fn check(&self) -> Option<Authorization>
pub fn check(&self) -> Option<Authorization>
If the inner Select selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Transaction>
impl Permission<Transaction>
Sourcepub fn check(
&self,
operation: &(impl PartialEq<TransactionOperation> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, operation: &(impl PartialEq<TransactionOperation> + ?Sized), ) -> Option<Authorization>
If the inner Transaction selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Update>
impl Permission<Update>
Source§impl Permission<Attach>
impl Permission<Attach>
Sourcepub fn check(
&self,
filename: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, filename: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Attach selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Detach>
impl Permission<Detach>
Sourcepub fn check(
&self,
database_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, database_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Detach selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<AlterTable>
impl Permission<AlterTable>
Sourcepub fn check(
&self,
database_name: &(impl PartialEq<String> + ?Sized),
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, database_name: &(impl PartialEq<String> + ?Sized), table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner AlterTable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Reindex>
impl Permission<Reindex>
Sourcepub fn check(
&self,
index_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, index_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Reindex selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Analyze>
impl Permission<Analyze>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Analyze selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<CreateVtable>
impl Permission<CreateVtable>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
module_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), module_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner CreateVtable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<DropVtable>
impl Permission<DropVtable>
Sourcepub fn check(
&self,
table_name: &(impl PartialEq<String> + ?Sized),
module_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, table_name: &(impl PartialEq<String> + ?Sized), module_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner DropVtable selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Function>
impl Permission<Function>
Sourcepub fn check(
&self,
function_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, function_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Function selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Savepoint>
impl Permission<Savepoint>
Sourcepub fn check(
&self,
operation: &(impl PartialEq<TransactionOperation> + ?Sized),
savepoint_name: &(impl PartialEq<String> + ?Sized),
) -> Option<Authorization>
pub fn check( &self, operation: &(impl PartialEq<TransactionOperation> + ?Sized), savepoint_name: &(impl PartialEq<String> + ?Sized), ) -> Option<Authorization>
If the inner Savepoint selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Source§impl Permission<Recursive>
impl Permission<Recursive>
Sourcepub fn check(&self) -> Option<Authorization>
pub fn check(&self) -> Option<Authorization>
If the inner Recursive selector matches the given fields, returns the Authorization implied by this permission’s allow flag. Returns None on no match.
Trait Implementations§
Source§impl<T: Clone> Clone for Permission<T>
impl<T: Clone> Clone for Permission<T>
Source§fn clone(&self) -> Permission<T>
fn clone(&self) -> Permission<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more