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
impl Resource for AuditLog
Source§type Model = AuditEntry
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>
type Form = NoForm<AuditEntry>
The typed value the create and edit forms parse into. Read more
Source§fn declare() -> ResourceDef<Self>
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 moreSource§async fn delete_record(
_cx: &Cx,
_record: &AuditEntry,
_ex: &mut dyn Executor,
) -> Result<(), WriteError>
async fn delete_record( _cx: &Cx, _record: &AuditEntry, _ex: &mut dyn Executor, ) -> Result<(), WriteError>
Delete the already-authorized
record. Read moreSource§async fn restore_record(
_cx: &Cx,
_record: &AuditEntry,
_ex: &mut dyn Executor,
) -> Result<(), WriteError>
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 moreSource§async fn force_delete_record(
_cx: &Cx,
_record: &AuditEntry,
_ex: &mut dyn Executor,
) -> Result<(), WriteError>
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 moreSource§fn validate_record(
_cx: &Cx,
_form: &Self::Form,
) -> FieldErrors<<Self::Form as RecordForm>::Field>
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 moreSource§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
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
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 moreSource§fn bulk_delete_records(
cx: &Cx,
records: &[Self::Model],
ex: &mut dyn Executor,
) -> impl Future<Output = Result<(), WriteError>> + Send
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
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 moreAuto Trait Implementations§
impl Forget for AuditLog
impl Freeze for AuditLog
impl RefUnwindSafe for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
impl UnwindSafe for AuditLog
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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<R> OptionSource for Rwhere
R: Resource,
impl<R> OptionSource for Rwhere
R: Resource,
Source§fn label(cx: &Cx, record: &<R as Resource>::Model) -> String
fn label(cx: &Cx, record: &<R as Resource>::Model) -> String
The record’s title, as its detail page shows it.
Source§fn scoped_query(cx: &Cx) -> Result<Query<List<<R as Resource>::Model>>, Error>
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
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
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>>
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>
fn order_by(cx: &Cx) -> Option<OrderByExpr>
States the related source’s declared default ordering.