Struct create_rust_app::auth::Permission
source · [−]Fields
from_role: Stringpermission: StringImplementations
sourceimpl Permission
impl Permission
pub fn grant_to_user(
db: &mut Connection,
user_id: i32,
permission: &str
) -> Result<bool>
pub fn grant_to_role(
db: &mut Connection,
role: &str,
permission: &str
) -> Result<bool>
pub fn grant_many_to_role(
db: &mut Connection,
role: String,
permissions: Vec<String>
) -> Result<bool>
pub fn grant_many_to_user(
db: &mut Connection,
user_id: i32,
permissions: Vec<String>
) -> Result<bool>
pub fn revoke_from_user(
db: &mut Connection,
user_id: i32,
permission: &str
) -> Result<bool>
pub fn revoke_from_role(
db: &mut Connection,
role: String,
permission: String
) -> Result<bool>
pub fn revoke_many_from_user(
db: &mut Connection,
user_id: i32,
permissions: Vec<String>
) -> Result<bool>
pub fn revoke_many_from_role(
db: &mut Connection,
role: String,
permissions: Vec<String>
) -> Result<bool>
pub fn revoke_all_from_role(db: &mut Connection, role: &str) -> Result<bool>
pub fn revoke_all_from_user(db: &mut Connection, user_id: i32) -> Result<bool>
pub fn fetch_all(db: &mut Connection, user_id: i32) -> Result<Vec<Permission>>
Trait Implementations
sourceimpl Clone for Permission
impl Clone for Permission
sourcefn clone(&self) -> Permission
fn clone(&self) -> Permission
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for Permission
impl Debug for Permission
sourceimpl<'de> Deserialize<'de> for Permission
impl<'de> Deserialize<'de> for Permission
sourcefn 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
sourceimpl Hash for Permission
impl Hash for Permission
sourceimpl PartialEq<Permission> for Permission
impl PartialEq<Permission> for Permission
sourceimpl<__DB: Backend> QueryableByName<__DB> for Permission where
String: FromSql<Text, __DB>,
String: FromSql<Text, __DB>,
impl<__DB: Backend> QueryableByName<__DB> for Permission where
String: FromSql<Text, __DB>,
String: FromSql<Text, __DB>,
sourceimpl Serialize for Permission
impl Serialize for Permission
impl Eq for Permission
Auto Trait Implementations
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnwindSafe for Permission
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<DB, T> FromSqlRow<Untyped, DB> for T where
DB: Backend,
T: QueryableByName<DB>,
impl<DB, T> FromSqlRow<Untyped, DB> for T where
DB: Backend,
T: QueryableByName<DB>,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
Convert self to an expression for Diesel’s query builder. Read more
sourcefn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
T: SqlType + TypedExpressionType,
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
T: SqlType + TypedExpressionType,
&'a Self: AsExpression<T>,
Convert &self to an expression for Diesel’s query builder. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more