Skip to content

CakePHPMitra/CakePHP_RBAC

Repository files navigation

RBAC for CakePHP 5

CakePHP 5 PHP 8.1+ License: MIT

Latest Version Stable Version

GitHub Stars GitHub Forks

Database-backed Role-Based Access Control for CakePHP 5 applications with CakeDC/Users integration.


Features

  • Database-backed roles and permissions (runtime manageable via admin UI)
  • Pivot tables: users_roles, users_permissions for flexible assignment
  • Both role-based and direct user permission assignment
  • String-based custom permissions AND controller/action auto-discovery
  • CakePHP Authorization plugin integration with custom DB resolver
  • Configurable multi-role support (single role default, opt-in multi-role)
  • Configurable superadmin bypass role (defaults to 'superadmin')
  • Permission caching with auto-invalidation (enabled by default)
  • Full admin UI for managing roles, permissions, and user assignments
  • View helper for permission checks in templates
  • Middleware for automatic controller/action permission enforcement
  • Overridable from host application

Requirements

Requirement Version
PHP >= 8.1
CakePHP ^5.0
CakeDC/Users ^16.0
CakePHP Authorization ^3.0

Installation

  1. Add the repository to your composer.json:
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/CakePHPMitra/CakePHP_RBAC"
        }
    ]
}
  1. Install via Composer:
composer require cakephpmitra/rbac:dev-main
  1. Load the plugin:
bin/cake plugin load Rbac

Or add to src/Application.php in the bootstrap() method:

$this->addPlugin('Rbac');
  1. Run migrations:
bin/cake migrations migrate --plugin Rbac

Quick Start

TODO: Add quick start guide after implementation.

Documentation

See the docs folder for detailed documentation:

Contributing

See CONTRIBUTING.md for guidelines.

Issues

Report bugs and feature requests on the Issue Tracker.

Author

Atul Mahankal

License

MIT License - see LICENSE file.

About

Database-backed Role-Based Access Control for CakePHP 5 with CakeDC/Users integration

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages