pub struct AttributePolicy;Expand description
Resource policy for Attribute — maps CRUD actions to permission strings.
Trait Implementations§
Source§impl ResourcePolicy<Attribute> for AttributePolicy
impl ResourcePolicy<Attribute> for AttributePolicy
fn can<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
action: ResourceAction,
_entity: &'life1 Attribute,
ctx: &'life2 AuthContext,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn resource_type() -> &'static strwhere
Self: Sized,
fn resource_type() -> &'static strwhere
Self: Sized,
The resource type name used in permission strings. Read more
Source§fn create_permission() -> &'static strwhere
Self: Sized,
fn create_permission() -> &'static strwhere
Self: Sized,
Permission string required to create this resource.
Source§fn read_permission() -> &'static strwhere
Self: Sized,
fn read_permission() -> &'static strwhere
Self: Sized,
Permission string required to read/fetch this resource.
Source§fn list_permission() -> &'static strwhere
Self: Sized,
fn list_permission() -> &'static strwhere
Self: Sized,
Permission string required to list this resource.
Source§fn update_permission() -> &'static strwhere
Self: Sized,
fn update_permission() -> &'static strwhere
Self: Sized,
Permission string required to fully update this resource.
Source§fn patch_permission() -> &'static strwhere
Self: Sized,
fn patch_permission() -> &'static strwhere
Self: Sized,
Permission string required to partially patch this resource.
Source§fn delete_permission() -> &'static strwhere
Self: Sized,
fn delete_permission() -> &'static strwhere
Self: Sized,
Permission string required to delete this resource.
Source§fn restore_permission() -> &'static strwhere
Self: Sized,
fn restore_permission() -> &'static strwhere
Self: Sized,
Permission string required to restore a soft-deleted resource.
Source§fn explicitly_disabled_actions(&self) -> Vec<ResourceAction>
fn explicitly_disabled_actions(&self) -> Vec<ResourceAction>
Optional: deny specific actions for all callers (e.g. hard-delete disabled).
Auto Trait Implementations§
impl Freeze for AttributePolicy
impl RefUnwindSafe for AttributePolicy
impl Send for AttributePolicy
impl Sync for AttributePolicy
impl Unpin for AttributePolicy
impl UnsafeUnpin for AttributePolicy
impl UnwindSafe for AttributePolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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