CMS accounts table with Superadmin role
CMS roles

Appifio Creator · Lesson T07 · Technical

Roles: user · admin · superadmin
and guests who are not signed in

Who can delete a post, who can delete an admin, who can only submit a form - get roles wrong and you get a security hole or a button that “does nothing.”

Goal: Know the permission matrix; understand the admin session; use the auth APIs correctly - never read login.json.

Time: 12-14 min · Before: F03, G01 · After: T08

UI: /cms setup · Backend admin list · Add admin · Role Superadmin/Admin · Permissions

1. Permission diagram

Guest (no admin session):
→ public read · appendData (if policy allows) · ❌ writeFile/updateData/delete/upload
user (editor):
→ create/edit content · ❌ deleteFile/hardDelete · ❌ cms-settings · ❌ manage admins
admin:
→ CRUD entities · routes · project file store · restore · upload · soft delete
superadmin:
→ everything admin has + listAdmins · updateAdmin · deleteAdmin · registerAdmin · hardDeleteFile

2. API permission table (condensed)

API / actionguestuseradminsuperadmin
appendData (public form)✓*
updateData / deleteFile
writeFile cms-settings
registerAdmin / deleteAdmin

* Guest append depends on CMS/manifest policy - the backend enforces it; hiding a button in the UI is not enough.

3. Glossary & admin session

TermMeaning
Admin sessionAfter CMS login, the admin session is kept in the browser
Check admin still signed inAdmin pages verify the session - expired → login page
login.jsonDirect read/write is denied (T04, X11)

4. Steps

  1. First visit to /{url}/cms: setup form → create a superadmin (Username, Password, Confirm).
  2. Backend tab → Add admin → Role Superadmin or Admin.
  3. AI-built admin pages: check the admin session first; APIs carry admin rights after CMS login.
  4. Prompt tip: “Public pages only appendData. /admin requires login + the correct role.”
  5. changePassword → old sessions are invalidated (as the UI help describes).
  6. Offboarding: Delete admin + type the username to confirm (superadmin).

5. Comparisons · Security

  • WordPress Subscriber/Editor/Admin: roughly maps to user/admin/superadmin.
  • Firebase custom claims: role rides with the session - similar to admin rights after CMS login.

Security: never store passwords in plain text; never put the admin session in Git/HTML; hiding a button ≠ safe - the backend blocks APIs for the wrong role.

6. Example flow by page

// contact.html (public)
submit → appendData('contacts.json', { name, email })
// admin-contacts.html
onLoad → check admin session (expired → login page)
if admin → readList('contacts.json') → render table
if user role → updateData OK · deleteFile blocked

7. Issues · Checklist

IssueFix
user cannot delete a postCorrect by policy - promote to admin
Guest calls updateDataBackend blocks it - fix the frontend
Lost superadmin accessX11 - changePassword / support; do not edit login.json
  1. Can you list guest vs superadmin rights?
  2. Do you keep AI from reading login.json?
  3. Are public and /admin pages calling APIs with the right roles?

Next: T08 - Routes vs file path

Appifio Creator · User guide · T07