PHP-RBAC is the de-facto authorization library for PHP. It provides developers with NIST Level 2 Standard Role Based Access Control and more, in the fastest implementation yet.
PHP-RBAC is an authorization library for PHP. It provides developers with NIST Level 2 Hierarchical Role Based Access Control and more, in the fastest implementation yet.
Current Stable Release: PHP-RBAC v2.0
- Home Page: http://phprbac.net/
- OWASP Project Page: https://www.owasp.org/index.php/Phprbac
- PHP-RBAC Documentation: http://phprbac.net/docs_contents.php
- PHP-RBAC Wiki: https://github.com/OWASP/rbac/wiki
- PHP-RBAC API: http://phprbac.net/api.php
- Issue Tracker: https://github.com/OWASP/rbac/issues?state=open
- Mailing List: https://lists.owasp.org/mailman/listinfo/owasp_phprbac
For information regarding NIST RBAC Levels, please see This Paper.
For more great resources see the NIST RBAC Group Page.
You can now use Composer to install the PHP-RBAC code base.
Instantiating a PHP-RBAC Object
With a 'use' statement:
use PhpRbac; $rbac = new Rbac();
Without a 'use' statement, outside of a namespace:
$rbac = new PhpRbac\Rbac();
Without a 'use' statement, inside of another namespace (notice the leading backslash):
$rbac = new \PhpRbac\Rbac();
PHP-RBAC's Public API is now fully PSR-0, PSR-1 and PSR-2 compliant.
You can now:
- Use Composer to install/update PHP-RBAC
- Use any PSR-0 compliant autoloader with PHP-RBAC
- Use the included autoloader to load PHP-RBAC
If you notice any conflicts with PSR compliance please Submit an Issue.
We are in the process of refactoring the PHP-RBAC internals. We have two goals in mind while doing this:
- To meet modern PHP OOP "Best Practices"
- To meet PHP-FIG PSR compliance: http://www.php-fig.org/
With a PSR compliant Public API already in place we can continue to work towards our goals one piece at a time without altering the Public API that developers are working with and rely on, making the transition as seamless and invisible as possible.
We welcome all contributions that will help make PHP-RBAC even better tomorrow than it is today!
Please visit the PHP-RBAC Wiki to learn about our development process and workflow.
- Report Bugs, Enhancement Requests or Documentation errors using our Issue Tracker
- Choose a Bug to work on and submit a Pull Request
- Make helpful suggestions and contributions to the Documentation using our Issue Tracker
- Spread the word about PHP-RBAC by: