Prompt
How do I set up approvals, permissions, and audit logs in a low-code app?
Latest observation
To set up approvals, permissions, and audit logs in a low-code app, think of it as three layers:
- Who can do what — permissions
- Who must approve what — approvals/workflows
- What happened and when — audit logs
Below is a practical way to design each.
1) Permissions: control access by role and record
Start with roles
Define the main user roles first, for example:
- Admin — manage everything
- Manager — review/approve requests
- Editor — create and edit items
- Viewer — read-only access
Use role-based access control
Most low-code platforms support role-based security. Set permissions for:
- Pages/screens: who can open them
- Actions: who can create, edit, delete, submit, approve
- Data rows/records: who can see or modify specific records
Add record-level rules
Often you need more than just “role = manager.” Common rules:
- Users can edit only records they created
- Managers can view records in their department
- Only approvers assigned to a request can approve it
- HR records are visible only to HR users
Best practice
Use a mix of:
- Global roles for broad access
- Conditional rules for specific records or workflow states
Example logic:
- If user is Admin → full access
- If record status is Draft and user is owner → can edit
- If record status is Pending Approval → only approver can act
- If record status is Approved → read-only for most users
2) Approvals: build a workflow with statuses
Use status fields
Add a field like:
DraftSubmittedPending ApprovalApprovedRejectedCancelled
This makes the workflow easy to control.
Set up the approval path
Typical pattern:
- User creates record in Draft
- User clicks Submit
- Status changes to Pending Approval
- Approver gets notified
- Approver chooses Approve or Reject
- Status updates accordingly
Support multi-step approvals if needed
For more complex processes:
- Step 1: Manager approval
- Step 2: Finance approval
- Step 3: Final admin approval
Store:
- current approval step
- assigned approver
- approval decision
- decision timestamp
Use workflow conditions
Examples:
- If amount > $5,000, require extra approval
- If request type = “Legal”, route to legal team
- If department = Sales, route to Sales manager
Good approval UX
Make it easy for users to:
- submit requests
- see current status
- see who approved or rejected
- leave comments or rejection reasons
3) Audit logs: record every important action
Audit logs are essential for accountability and compliance.
What to log
Capture events like:
- record created
- record edited
- record deleted
- submitted for approval
- approval/rejection action
- permission changes
- login/logout if needed
- status changes
- attachment uploads/removals
What each audit entry should include
A good audit log record usually has:
- Timestamp
- User ID / username
- Action type
- Record ID
- Old value
- New value
- IP address or device info if available
- Comments/reason
- Workflow step
Use immutable logs
Audit logs should generally be:
- append-only
- not editable by normal users
- visible only to admins/compliance users
Keep logs separate from business data
Don’t store audit information only in the main record. Use a dedicated audit table/log collection so history isn’t lost when the record changes.
4) Recommended architecture
A simple pattern that works well in low-code tools:
Main tables/collections
- Users
- Roles
- Permissions
- Business Records (orders, requests, tickets, etc.)
- Approvals
- Audit Logs
Business record fields
idcreatedBystatusassignedApprovercurrentStepapprovalHistory- timestamps
Approval table fields
recordIdstepNumberapproverIddecisiondecisionDatecomments
Audit log fields
entityTypeentityIdactionperformedBybeforeaftertimestamp
5) Implementation checklist
Permissions
- Define roles
- Map roles to pages/actions/data
- Add record-level rules
- Test edge cases
Approvals
- Add status field
- Create submit/approve/reject actions
- Assign approvers dynamically
- Add notifications
- Store approval history
Audit logs
- Log all sensitive actions
- Record before/after values
- Make logs read-only
- Add admin audit view
- Ensure logs are retained securely
6) Common mistakes to avoid
- Relying only on UI hiding instead of backend security
- Letting users edit approved records
- Not logging who approved what
- Overwriting history instead of storing it
- Giving admins too much access without audit tracking
- Forgetting to secure attachments and exports
7) Simple example flow
Imagine a purchase request app:
- Employee creates request
- Employee submits it
- Manager reviews it
- If under $1,000, manager approves directly
- If over $1,000, finance also approves
- Every action is logged
- Employees can only see their own requests
- Managers can see requests for their team
- Admins can see everything
8) Platform-specific note
If you’re using a specific low-code platform, the exact setup depends on it:
- Microsoft Power Apps / Power Automate
- OutSystems
- Mendix
- AppSheet
- Retool
- Bubble
- Zoho Creator
They all support these concepts, but the configuration differs.
If you want, I can give you:
- a generic database/schema design,
- a workflow example, or
- step-by-step instructions for a specific platform.