Settings

class alliance_platform.audit.settings.AlliancePlatformAuditSettingsType[source]

Settings for the Audit package of the Alliance Platform

These can be set in the Django settings file under the ALLIANCE_PLATFORM key:

ALLIANCE_PLATFORM = {
    "AUDIT": {
        # settings go here
    }
}
LIST_PERM_ACTION: str | None[source]

The name of the action used to evaluate permissions for auditing a model. Defaults to ‘audit’. The action name is passed through resolve_perm_name() to generate the permission.

CAN_AUDIT_PERM_NAME: str | None[source]

The name of the permission used to evaluate whether auditing of any type can be performed. If a user has audit permissions for a model, but not the permission specified here, they will be unable to audit models that they have permissions for.

USERNAME_FORMAT: Expression | F | None[source]

The SQL function used to generate the display name for users in audit logs. Defaults to Concat("first_name", Value(" "), "last_name"). If your user model does not include first_name and last_name fields, you will need to change this setting.

TRACK_IP_ADDRESS: bool | None[source]

Whether to include IP address in context logs. make sure you take GDPR into consideration (recording without disclosure is a violation; ie. minimal: your site need to have a privacy statement somewhere.). Defaults to False.

AUDIT_LOG_COMPONENT_PATH: str | None[source]

Path to frontend component for rendering audit log component. Defaults to "@alliancesoftware/ui-audit/AuditLog". Accepts .ts, .tsx, and .jsx extensions.