pub struct ActixAdminViewModelSerializable {
pub entity_name: String,
pub primary_key: String,
pub fields: &'static [ActixAdminViewModelField],
pub show_search: bool,
pub default_show_aside: bool,
pub inline_edit: bool,
pub can_create: bool,
pub can_edit: bool,
pub can_delete: bool,
pub can_view_details: bool,
pub can_export: bool,
pub bulk_actions: Vec<ActixAdminBulkAction>,
}Fields§
§entity_name: String§primary_key: String§fields: &'static [ActixAdminViewModelField]§show_search: bool§default_show_aside: bool§inline_edit: bool§can_create: boolSerialized permission flags, resolved for the current session. Filled
in per-request by add_default_context since the fn hooks themselves
are not serializable.
can_edit: bool§can_delete: bool§can_view_details: bool§can_export: bool§bulk_actions: Vec<ActixAdminBulkAction>Implementations§
Source§impl ActixAdminViewModelSerializable
impl ActixAdminViewModelSerializable
Sourcepub fn from_view_model(entity: &ActixAdminViewModel) -> Self
pub fn from_view_model(entity: &ActixAdminViewModel) -> Self
Build a serializable snapshot of entity with all can_* flags set
to false. Call sites that know the current session must set the
flags explicitly via [Self::set_permissions_for] (or the higher-level
helper add_default_context_with_session).
The least-privilege default matters: any code path that forgets to resolve permissions must render as if the user has no rights, not as if they were an admin.
Trait Implementations§
Source§impl Clone for ActixAdminViewModelSerializable
impl Clone for ActixAdminViewModelSerializable
Source§fn clone(&self) -> ActixAdminViewModelSerializable
fn clone(&self) -> ActixAdminViewModelSerializable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<ActixAdminViewModel> for ActixAdminViewModelSerializable
impl From<ActixAdminViewModel> for ActixAdminViewModelSerializable
Source§fn from(entity: ActixAdminViewModel) -> Self
fn from(entity: ActixAdminViewModel) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ActixAdminViewModelSerializable
impl RefUnwindSafe for ActixAdminViewModelSerializable
impl Send for ActixAdminViewModelSerializable
impl Sync for ActixAdminViewModelSerializable
impl Unpin for ActixAdminViewModelSerializable
impl UnsafeUnpin for ActixAdminViewModelSerializable
impl UnwindSafe for ActixAdminViewModelSerializable
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> 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