Skip to main content

AuditLog

Struct AuditLog 

Source
pub struct AuditLog;
Expand description

The read-only resource listing the AuditEntry rows of its panel, newest first, at {prefix}/audit-log, or under the area that places it. Panel::audit_log registers it.

It lists what happened on its own panel only, for the tenant the reader acts for, and to the resources the reader may list: an entry about a resource whose list the reader may not open stays out of it, and a field field_access hides from the reader reads “Hidden”.

Trait Implementations§

Source§

impl Resource for AuditLog

Source§

type Model = AuditEntry

The persisted model this resource administers. Its ModelColumns give the table and detail page the resource declares none of.
Source§

type Form = NoForm<AuditEntry>

The typed value the create and edit forms parse into. Read more
Source§

fn declare() -> ResourceDef<Self>

What the resource declares: names, navigation, policy, tenancy, table, form, detail page, relations and actions. Defaults to ResourceDef::new, whose policy denies all. Read more
Source§

async fn delete_record( _cx: &Cx, _record: &AuditEntry, _ex: &mut dyn Executor, ) -> Result<(), WriteError>

Delete the already-authorized record. Read more
Source§

async fn restore_record( _cx: &Cx, _record: &AuditEntry, _ex: &mut dyn Executor, ) -> Result<(), WriteError>

Restore the already-authorized trashed record of a resource that soft-deletes, inside the handler’s transaction. Read more
Source§

async fn force_delete_record( _cx: &Cx, _record: &AuditEntry, _ex: &mut dyn Executor, ) -> Result<(), WriteError>

Delete the already-authorized trashed record for good, inside the handler’s transaction. Read more
Source§

fn validate_record( _cx: &Cx, _form: &Self::Form, ) -> FieldErrors<<Self::Form as RecordForm>::Field>

App-level rules on the parsed form. The errors render inline with a 200 and nothing is written, so a range or cross-field rule belongs here. A rule that reads the database belongs in create_record or update_record, which refuse through the transaction they write in. Read more
Source§

fn create_record( cx: &Cx, form: Self::Form, ex: &mut dyn Executor, ) -> impl Future<Output = Result<Self::Model, WriteError<<Self::Form as RecordForm>::Field>>> + Send

Create a record from the parsed form, inside the handler’s transaction. Read more
Source§

fn update_record( cx: &Cx, record: Self::Model, posted: Posted<Self::Form>, ex: &mut dyn Executor, ) -> impl Future<Output = Result<Self::Model, WriteError<<Self::Form as RecordForm>::Field>>> + Send

Update the already-authorized record from the posted form, inside the handler’s transaction. Read more
Source§

fn bulk_delete_records( cx: &Cx, records: &[Self::Model], ex: &mut dyn Executor, ) -> impl Future<Output = Result<(), WriteError>> + Send

Bulk-delete the already-authorized records: the handler fetches through the tenancy-scoped IN query inside the framework transaction, checks View on every row, and passes the rows Ability::Delete allows, skipping the rest as a bulk custom action does. The default deletes each record through Self::delete_record in order, through the same ex — any error rolls the whole batch back, so mid-loop failures delete zero rows. An override of delete_record, such as a soft delete, therefore covers bulk delete too. Override this for a single-statement batch.
Source§

fn before_commit( _cx: &Cx, _change: &Change<Self::Model>, _ex: &mut dyn Executor, ) -> impl Future<Output = Result<()>> + Send

Work inside the write’s transaction, after the record fn or action wrote: an audit row, a counter, a row in another table that must commit with the write or not at all. Work every resource of a panel does, such as an audit trail, belongs in a CommitHook, which the panel runs right after this one. Read more
Source§

fn after_commit( _cx: &Cx, _change: Change<Self::Model>, ) -> impl Future<Output = Result<()>> + Send

Work after the write commits, outside the database: an email, a webhook, cache invalidation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<R> OptionSource for R
where R: Resource,

Source§

fn label(cx: &Cx, record: &<R as Resource>::Model) -> String

The record’s title, as its detail page shows it.

Source§

type Model = <R as Resource>::Model

The model whose rows become options.
Source§

fn scoped_query(cx: &Cx) -> Result<Query<List<<R as Resource>::Model>>, Error>

States the tenant-scoped seed query every option load starts from and reports an unscopable source as misdeclared.
Source§

fn lists(cx: &Cx) -> bool

Whether the current user may list the source’s rows; refusing fails every load closed. Defaults to refusing. The rows the user may not see belong out of scoped_query.
Source§

fn requires_tenant(cx: &Cx) -> bool

Declares whether the source’s rows are tenant-owned and fails a tenantless request closed. Read more
Source§

fn search_expr(cx: &Cx, term: &str) -> Option<Expr<bool>>

States the related source’s search predicate for term, or None when it declares no searchable column.
Source§

fn order_by(cx: &Cx) -> Option<OrderByExpr>

States the related source’s declared default ordering.
Source§

fn available(cx: &Cx) -> bool

Source§

fn hidden_fields(cx: &Cx) -> Vec<String>

Source§

fn creates() -> bool

Source§

fn create_page(cx: &Cx) -> Option<String>

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more