esserj / rbac-user-doctrine-orm
A module that joins zfc-rbac & zfc-user in a pre-configured doctrine ORM based module
Installs: 98
Dependents: 1
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 10
Open Issues: 2
pkg:composer/esserj/rbac-user-doctrine-orm
Requires
- php: >=5.3.3
- doctrine/doctrine-orm-module: 0.7.*
- zendframework/zendframework: >2.2.0rc1
- zf-commons/zfc-rbac: dev-master
- zf-commons/zfc-user: dev-master
- zf-commons/zfc-user-doctrine-orm: dev-master
This package is not auto-updated.
Last update: 2025-10-20 21:18:28 UTC
README
RbacUserDoctrineOrm offers a module that combines ZfcRbac & ZfcUser together with the Doctrine Orm module from ZF2 so that you can focus on getting started.
Requirements & their dependencies
- PHP 5.3 or higher
- Zend Framework 2
- ZfcRbac
- ZfcUserDoctrineOrm
Installation
Installation of RbacUserDoctrineOrm uses composer. For composer documentation, please refer to getcomposer.org.
Installation steps
-
cd my/project/directory -
create a
composer.jsonfile with following contents:{ "require": { "esserj/rbac-user-doctrine-orm": "dev-master" } } -
install composer via
curl -s http://getcomposer.org/installer | php(on windows, download http://getcomposer.org/installer and execute it with PHP) -
run
php composer.phar install -
open
my/project/directory/configs/application.config.phpand add the following to yourmoduleskey:'DoctrineModule', 'DoctrineORMModule', 'ZfcBase', 'ZfcRbac', 'ZfcUser', 'ZfcUserDoctrineORM', 'RbacUserDoctrineOrm',
-
run the schema-full.sql file found in
my/project/directory/vendor/esserj/rbac-user-doctrine-orm/dataor alternatively run the schema.sql if you already installed ZfcUser or ZfcRbac schemas -
setup doctrine database parameters by adding the following to your
my/project/config/autoload/local.php:'doctrine' => array( 'connection' => array( // default connection name 'orm_default' => array( 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', 'params' => array( 'host' => 'localhost', 'port' => '3306', 'user' => '', //put your user here 'password' => '', //put your pass here 'dbname' => '', //put your database here ) ) ) )
```
- see the ZfcUser & ZfcRbac pages for controller/view plugins to get started
Providers
Providers are listeners that hook into various events to provide roles and permissions. ZfcRbac ships with several providers that you can use out of the box, but none support ORM, this is where we come in:
- Generic Providers:
- Permissions & Roles (RbacUserDoctrineOrm\Provider\AdjacencyList\Role): uses Doctrine ORM to inject Role entities that have permission entities compatible with the ZfcRbac RoleInterface