Download the PHP package spomky-labs/role-hierarchy-bundle without Composer
On this page you can find all versions of the php package spomky-labs/role-hierarchy-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spomky-labs/role-hierarchy-bundle
More information about spomky-labs/role-hierarchy-bundle
Files in spomky-labs/role-hierarchy-bundle
Package role-hierarchy-bundle
Short Description Symfony2 Role Hierarchy Bundle
License MIT
Homepage https://github.com/Spomky-Labs/RoleHierarchyBundle
Informations about the package role-hierarchy-bundle
Role Hierarchy
Prerequisites
This version of the bundle requires:
- Symfony 2.8 or 3.0+
- PHP 5.6+
It has been successfully tested using PHP 5.6
to PHP 7.0
and HHVM
under Symfony 2.8
to 3.0
.
Installation
Installation is a quick 4 steps process:
- Install the bundle
- Enable the bundle
- Create your model class
- Configure the bundle
Step 1: Install the bundle
The preferred way to install this bundle is to rely on Composer:
Step 2: Enable the bundle
Finally, enable the bundle in the kernel:
Step 3: Create model class
This bundle needs to persist roles to a database:
Your first job, then, is to create a role class for your application. This class can look and act however you want: add any properties or methods you find useful.
There is just a few requirements:
- They must be sure that role names are unique
- They should follow naming conventions
In the following sections, you'll see an example of how your class should look.
Your class can live inside any bundle in your application. For example, if you work at "Acme" company, then you might create a bundle called AcmeRoleBundle and place your classs in it.
This bundle is able to support Doctrine ORM, ODM, CouchDB or MongoDB. Please note that only ORM has been tested.
Doctrine ORM
If you are persisting your data via the Doctrine ORM, then your class should live in the Entity namespace of your bundle and look like this to start:
Doctrine ODM
To be written
Couch DB
To be written
Mongo DB
To be written
Step 4: Configure your application
If you have your own roles manager, you can use it. It just needs to implement SpomkyLabs\RoleHierarchyBundle\Model\RoleManagerInterface
.
All versions of role-hierarchy-bundle with dependencies
symfony/security-bundle Version ^2.8|^3.0
doctrine/doctrine-bundle Version ^1.0