Architecture Note:
nuxt-auto-crud(Core) enforces gates at the API/Nitro layer. The Template provides the UI for state management.
The RBAC state is persisted in SQLite via five core tables:
roles: Subject identities (e.g., admin, manager).resources: Object entities (mapped 1:1 to Drizzle table names).permissions: Valid actions (e.g., list_own, update).role_resource_permissions: Junction table defining the Access Control List (ACL).users: Links identity to role.| Action | Logic / Requirement |
|---|---|
list | Returns records where status = 'active'. |
list_all | Returns all records (ignores status filter). |
create | Executes Zod-validated INSERT. |
read | Single record retrieval by Primary Key. |
update | Partial modification of existing record. |
delete | Hard or Soft delete based on schema configuration. |
Logic dependent on createdBy or userId presence in Drizzle schema.
list_own: SELECT where createdBy == current_user_id.update_own: UPDATE restricted to owner-matching rows.delete_own: DELETE restricted to owner-matching rows.admin, manager, user, public) and existing Drizzle tables are registered as resources.resources via Admin UI.Managed via 'Resource Permissions' (Admin UI):
private (Session Required).public role to bypass session verification.app.config.ts)The crud object in app.config.ts defines the static visibility boundaries for the NAC Interface. These settings govern how data is projected in the UI and serialized during exports.
rolesToSeed: Custom role identities (e.g., moderator) injected during the initial bootstrap.globalHide: Keys strictly excluded from the dynamic Data Table UI across all resources.exports: Granular control for PDF and Excel generation.globalExclude: System-wide omissions for the specific format.resourceExclude: Table-specific overrides (e.g., hiding password or internalNote for the users resource).!NOTE For a deep dive into data serialization logic, refer to the Data Export Documentation.
!TIPAgentic Context: When an LLM tool executes a
listorexportoperation, it must respect these configuration arrays as hard constraints to avoid attempting to process or display restricted fields.