Database-Backed Permissions

Wikantik keeps its role-based permission policy in PostgreSQL. The policy_grants table replaced the flat WEB-INF/wikantik.policy file that JSPWiki used, so an administrator can change what a role, group or user may do while the wiki is running, from Admin → Security (/admin/security, see Admin Security UI) or the /admin/policy API, with no redeploy or restart.

policy_grants answers "what may this role do". Two other mechanisms narrow or extend it and are not stored there: group membership (the groups and group_members tables) and [{ALLOW ...}]() ACLs written in a page body. The Wiki Permission Model Guide shows how the three fit together. Page visibility is decided in application code (DefaultAuthorizationManager, with ACLs read from the page text), not by PostgreSQL row-level security or an external policy engine.

How it works

Tables

They are created by migrations in bin/db/migrations/, applied by bin/db/migrate.sh (which bin/deploy-local.sh and bin/redeploy.sh run for you). There is no separate DDL script.

Default grants

V003 seeds the baseline and never overwrites operator changes (ON CONFLICT DO NOTHING). V043__admin_allpermission_canonical.sql later collapsed the two Admin wildcard rows into one all row, and V060__wiki_export_permission.sql added export to Authenticated.

RoleSeeded permissions
All (everyone, including anonymous visitors)view any page; editPreferences, editProfile, login
Authenticatedmodify and rename pages; createPages, createGroups, export; view groups; edit groups they belong to
Assertedview groups
AdminAllPermission

Page actions form a hierarchy: delete implies modify, modify implies edit and upload, rename implies edit, edit implies comment, and comment and upload imply view. So a seeded Authenticated user can edit, comment and upload attachments, but only Admin can delete pages.

Guardrails on editing grants

/admin/policy validates every write (AdminPolicyResource):

Impact

Database-backed groups and policy were a prerequisite for both the Admin Security UI and the Knowledge Graph, which needed database-backed group membership. For the operator view of the whole model, including scoped admin area grants, see docs/admin/Security.md in the repository.


Cluster Hub: Wikantik Platform Development Hub: Architecture, MCP Protocols, and Agent Briefings (wikantik-development)