StoreMate Admin – Guide, Roles, Actions, Security, UAT
Audience: staff who use /admin/ and the people who operate it.
1. Everyday use
Home (/admin/) shows what an admin needs, per period vs. the previous one: Needs your attention (approvals, KYC, urgent/unassigned tickets, failed payments & webhooks, unpaid curator earnings, data-deletion requests, subscriptions ending), KPIs (users, active subscriptions, revenue, commission, teams, open tickets), trends, latest sign-ups/payments/tickets and a system-health warning. Each staff member only sees the sections their permissions allow; product/scan/inventory data is intentionally not shown.
| Task | How |
|---|---|
| Find anything | Top bar Search everything (Ctrl/Cmd+K) – users, products, tickets, payments… |
| Search one list | Search box (/ to focus). Live results. Target one field: email:john status:paid, quotes for spaces: name:"acme corp". |
| Filter | Dropdowns auto-apply. ✕ clears one filter, chips show what is active, Clear all resets everything. Amount / date range filters take from → to. |
| Page size, columns, density | Per-page selector, Columns, Compact (stored in your browser). |
| Saved views | Views → Save current view (filters + search + sort + columns; stored in your browser, not shared). |
| Edit in the list | Change a cell, then Save changes in the bar (or Ctrl+S). A lone on/off toggle saves instantly. |
| Edit forms | Ctrl+S saves, unsaved changes are warned, inline rows can be dragged to reorder (rows with a sort/position column). |
| Export | Select rows → Export selected (CSV / .xlsx). CSV is ;-separated with BOM for Swiss/DE Excel; dates 31.12.2026. |
| Bulk edit | Select rows → Bulk edit a field on selected… (yes/no and choice fields; reason is mandatory; max 500 rows). |
| Dark mode, shortcuts | Moon icon in the top bar; ? lists shortcuts. |
2. Actions
Every action runs through one framework: confirmation page (for medium/high risk), optional reason, and an audit-log entry (Transactions → System audit logs) with who / what / which rows / why.
Editable without a deploy: Transactions → Admin action settings – change the menu label, the warning text, whether a
reason is required, or hide an action. New actions are wrapped by adding them to ACTION_POLICY in utils/admin_actions.py.
| Action | Where | Risk | Notes |
|---|---|---|---|
| Pay out selected via Stripe Connect | Curator earnings | High | reason required, also a button on the detail page |
| Reject selected applications | Curator onboarding applications | High | reason required |
| Approve selected applications | Curator onboarding applications | Medium | |
| Cancel add-ons / subscriptions | User add-ons / subscriptions | High | has its own confirmation page |
| Archive add-ons, deactivate plans, disable countries, retry setup / webhooks | Payments | Medium | |
| Sync / refresh from Stripe, resend invitation | Payments, Teams, Curation | Low | detail-page button |
| Download personal-data export | Users | Warning-level audit | GDPR/nFADP access request; blocked by an active retention hold |
| Export CSV / xlsx, Bulk edit | every list | audited |
Detail pages show the applicable actions under Actions (right column). They open the same confirmation page.
3. Roles
Run once (and after adding apps): python manage.py setup_admin_roles
| Group | Can do |
|---|---|
| Support | tickets & help content (full); view users, teams, inventory, products |
| Finance | view + change payments; view transactions, reports, curation, users |
| Compliance | audit logs & data-protection records (full); view accounts, legal, payments, admin history |
| Read-only Auditor | view everything, change nothing |
Superusers ignore groups. Privilege flags (is_staff, is_superuser) can never be bulk-edited. Audit logs and the admin
history (Admin log entries) are append-only: no add / edit / delete. Billing history cannot be deleted.
4. Security
| Setting (env) | Default | Meaning |
|---|---|---|
ADMIN_REQUIRE_2FA |
off | Staff must enter an authenticator-app code after login. Roll-out: 1) each person opens /admin/two-factor/ and enrols, 2) then set ADMIN_REQUIRE_2FA=True. Lost phone: delete their row in Accounts → Admin 2FA devices. |
ADMIN_IDLE_TIMEOUT_SECONDS |
1800 | Auto logout after inactivity (0 = off) |
ADMIN_LOGIN_MAX_ATTEMPTS / ADMIN_LOGIN_LOCK_SECONDS |
5 / 900 | Lock login per username + IP after repeated failures |
ADMIN_TIME_ZONE |
Europe/Zurich | Fallback timezone in /admin/ for staff without a profile timezone. Normally each person's own User profile → timezone is used (pick it in Accounts → User profiles). |
SECURE_HSTS_SECONDS |
0 | Set 31536000 once HTTPS is final |
ERROR_REPORT_EMAILS |
mailtokhajan@gmail.com | Full-traceback email for every 500 / logged error (also superusers + ADMIN_EMAILS); repeats throttled to 1 per 5 min |
DEBUG |
False | Must stay False in production |
Also required in production: SESSION_COOKIE_SECURE=True, CSRF_COOKIE_SECURE=True (site served over HTTPS), working SMTP
(EMAIL_HOST_USER, EMAIL_HOST_PASSWORD). Check everything at /admin/system-status/.
Login shows "session expired" instead of a bare 403 when the CSRF token is stale; the exact reason is logged (utils.csrf).
5. Languages & formats
Admin follows the user's language: EN, DE, FR, IT (and de-ch / fr-ch / it-ch). Admin-specific strings live in
locale_admin/ (python scripts/build_admin_locale.py regenerates them). Money shows Swiss style CHF 1’234.50,
dates dd.mm.yyyy, times in each user's profile timezone (fallback Europe/Zurich).
6. Speed notes
Lists skip the "N total" count, big-table counts are cached for 60 s, page size is selectable. python manage.py
admin_index_audit lists filter/search/ordering fields without a DB index (review before adding indexes on big tables).
7. UAT checklist (Swiss client demo)
- [ ] Login, wrong password ×5 → locked; correct login after lock time
- [ ] 2FA enrol + login with code (with
ADMIN_REQUIRE_2FA=True); idle timeout logs out - [ ] Global search finds a user by email and a product by name;
email:hint works in a list - [ ] Filters: set 3, remove one with ✕, Clear all; date and amount ranges on Billing history
- [ ] Inline edit a list toggle and a number; unsaved-changes warning on a form; drag-reorder an inline
- [ ] Payout / reject: confirmation page, reason, entry appears in System audit logs
- [ ] CSV export opens correctly in Excel (umlauts,
;columns, dates) - [ ] Language switch DE / FR / IT; amounts
CHF 1’234.50 - [ ] Personal-data export of a test user; blocked when a retention hold exists
- [ ] Cause a test exception → traceback email arrives
- [ ]
/admin/system-status/all green