rampage-php / rbac
This package is abandoned and no longer maintained.
No replacement package was suggested.
A leightweight Rbac implementation
1.0.1
2014-11-13 13:35 UTC
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2022-02-01 12:40:26 UTC
README
This is a leightweight Rbac implementation. It exists due to the ZF2 rbac implementation has some major design flaws.
Installation
Add a require statement to your composer.json composer.phar require rampage-php/rbac
.
Usage (brief)
A simple suage example
// let rbac instanciate standard roles $rbac = new rampage\rbac\Rbac(); $rbac->addRole('foo'); $rbac->addRole('bar', ['foo']); $rbac->getRole('foo')->allow('permission'); // instanciate your own roles (they need to implement rampage\rbac\RoleInterface) $role = new Role('baz') $role->addChild('bar'); // will utilize $rbac->getRole('bar') if present. $rbac->addRole($role);