Skip to content

Overview ​

TinyAuthBackend gives you a database-backed admin UI for permissions and roles in CakePHP. It is a companion to the TinyAuth plugin and replaces the native INI file approach with editable database tables.

The current branch targets CakePHP 5. Composer declares the supported PHP and framework ranges.

What you get ​

  • A self-contained admin UI mounted at /admin/auth.
  • Drop-in adapters (DbAllowAdapter, DbAclAdapter) that let TinyAuth read allow and acl rules from the database instead of INI files.
  • Optional resources, abilities, scopes, and role hierarchy for entity-level authorization.
  • TinyAuthPolicy and TinyAuthResolver for integration with the cakephp/authorization plugin.

TinyAuth Backend dashboard

Four usage strategies ​

The package supports four practical usage strategies, arranged as a ladder you can climb as your project's needs grow:

  1. Adapter-only TinyAuth, keep classic TinyAuth allow + acl behavior, but store those rules in the database instead of INI files.
  2. Full TinyAuthBackend, use the admin UI plus resources, scopes, role hierarchy, and TinyAuthPolicy / TinyAuthService for entity authorization.
  3. Backend UI + native CakePHP auth, keep CakePHP Authentication / Authorization as your runtime layer and use this package mainly as a DB-backed permission management UI.
  4. External role source, drive role aliases from a JWT claim, an LDAP group, an SSO gateway, or any other source outside the plugin, while keeping ACL / resource assignments in the backend.

See the Strategies overview for a comparison and pick the one that fits your app.

The admin URL ​

The plugin mounts under:

text
/admin/auth

Common sections:

URLPurpose
/admin/auth/allowPublic action management
/admin/auth/aclController/action ACL matrix
/admin/auth/rolesRoles and hierarchy
/admin/auth/resourcesResource abilities
/admin/auth/scopesField-based scopes
/admin/auth/sync/controllersScan controllers/actions into the database
/admin/auth/sync/resourcesScan entities/resources into the database

Access is fail-closed

The admin UI can change authorization rules. The plugin rejects every admin request with 403 until you configure an explicit gate. See Admin Access.

Next steps ​

Released under the MIT License.