pub async fn create(
pool: &PgPool,
actor: &Actor,
key: &str,
data_type: &str,
settings: AttributeSettings,
) -> AppResult<AttributeDef>Expand description
Creates a definition (administrators).
ยงInvariants
- Permission: admin role (403 otherwise). Key, data type and settings are validated (400); an existing key is a 409.
- Locks: none beyond the unique key of the definition.
- Audit:
attribute.create. - Notifications / webhooks: none.
- Atomic: one transaction.