Download the PHP package mgomezbuceta/cakephp-aclmanager without Composer
On this page you can find all versions of the php package mgomezbuceta/cakephp-aclmanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mgomezbuceta/cakephp-aclmanager
More information about mgomezbuceta/cakephp-aclmanager
Files in mgomezbuceta/cakephp-aclmanager
Package cakephp-aclmanager
Short Description Modern Authorization Manager for CakePHP 5.x - Role-based permission management system
License MIT
Homepage https://github.com/mgomezbuceta/cakephp-aclmanager
Informations about the package cakephp-aclmanager
π Features
| ### π― **Role-Based Access Control** Simple yet powerful RBAC system with role priorities and hierarchical permission management. ### π **Auto-Discovery** Automatically scans your application for controllers and actionsβno manual configuration needed. ### π¨ **Modern UI** Beautiful Bootstrap 5 interface with intuitive permission matrices and visual role management. ### π **Multilingual Support** Built-in i18n support with Spanish and Galician translations ready to use. | ### β‘ **High Performance** Built on CakePHP's Authorization plugin with permission caching for optimal performance. ### π‘οΈ **Secure by Default** Strict permission checking mode with comprehensive authorization middleware integration. ### π **CakePHP 5.x Native** Fully compatible with CakePHP 5.x using modern Authorization instead of deprecated ACL. |
π‘ Why Authorization Manager?
Traditional ACL systems (acos/aros) are deprecated in CakePHP 5.x. This plugin provides:
- β Modern Authorization - Uses CakePHP's official Authorization plugin
- β Simplified Structure - No more complex ACO/ARO trees
- β Visual Management - Web interface for managing permissions
- β Role-Based - Industry-standard RBAC pattern
- β Easy Integration - Drop-in authorization solution
- β Multilingual - Spanish and Galician translations included
π Requirements
| Requirement | Version |
|---|---|
| PHP | β₯ 8.1 |
| CakePHP | β₯ 5.0 |
| CakePHP Authorization | β₯ 3.0 |
π Installation
Step 1: Install via Composer
Step 2: Load the Plugin
Add to your src/Application.php:
Step 3: Run Migrations
Step 4: Sync Resources
Visit /authorization-manager and click "Sync Resources" to discover all your controllers and actions.
That's it! π
β‘ Quick Start
Basic Setup
-
Create Roles
- Visit
/authorization-manager/roles - Click "New Role"
- Create roles like: Administrator, Editor, Viewer
- Visit
-
Assign Permissions
- Click "Manage Permissions" for a role
- Check/uncheck permissions for each controller/action
- Click "Save Permissions"
- Integrate with Your Auth
Add role_id to Your Users Table
π Documentation
π§ Configuration Options
### Admin Access Control **IMPORTANT**: By default, only administrators can access the Authorization Manager. The plugin checks if the user is an admin using multiple methods (in order): 1. **role_name**: Checks if `role_name` is 'admin', 'administrator', or 'superadmin' 2. **role_id**: Checks if `role_id == 1` (typically admin role) 3. **is_admin**: Checks if `is_admin` flag is true 4. **email**: Checks against a whitelist of admin emails **To customize admin access**, add to your `config/app.php` in the return array: ### Session Timeout and Redirect When a user's session expires while using the Authorization Manager, they will be redirected to the login page with a `redirect` parameter containing the original URL. **To handle the redirect in your login controller**, add this code after successful authentication: This ensures users are returned to the Authorization Manager page they were viewing after logging in. ### Internationalization (i18n) The plugin comes with **Spanish (es_ES)** and **Galician (gl_ES)** translations out of the box. **To change the language**, add to your `config/bootstrap.php`: **To add your own translation:** 1. Create `resources/locales/{locale}/acl_manager.po` in your app 2. Copy entries from `vendor/mgomezbuceta/cakephp-aclmanager/resources/locales/es_ES/acl_manager.po` 3. Translate the `msgstr` values 4. Run `bin/cake i18n extract --plugin AclManager` to update ### Other Configuration Options In your `config/bootstrap.php`:ποΈ Database Schema
The plugin creates three tables: **roles** - User roles **permissions** - Role permissions **resources** - Available resources (auto-discovered)π Component Usage
π― Service Layer
π Troubleshooting
**No resources showing?** **Permission changes not taking effect?** **Getting "access denied" after setup?**π Migration from v2.x
β οΈ BREAKING CHANGE: Version 3.0 uses Authorization plugin instead of deprecated ACL.
Migration Steps:
-
Backup your data
-
Update composer.json
-
Run new migrations
-
Update routes
- Old:
/acl-manager - New:
/authorization-manager
- Old:
-
Update component
- Rebuild permissions
- Create new roles matching your old ARO structure
- Use "Sync Resources" to discover controllers
- Manually assign permissions (old ACL data cannot be migrated)
ποΈ Architecture
π€ Contributing
Contributions are welcome!
- π΄ Fork the repository
- πΏ Create your feature branch (
git checkout -b feature/amazing-feature) - π» Write clean, documented code following PSR-12
- β Add tests for new functionality
- π Commit your changes (
git commit -m 'Add amazing feature') - π Push to the branch (
git push origin feature/amazing-feature) - π Open a Pull Request
π License
This project is licensed under the MIT License - see LICENSE.md for details.
π¨βπ» Author
π Acknowledgments
This project evolved from the excellent ACL Manager foundation:
- IvΓ‘n Amat - Original CakePHP 4.x Acl Manager
- FrΓ©dΓ©ric Massart (FMCorz) - Original CakePHP 2.x AclManager
Special thanks to the CakePHP community for their continuous support.