0

I am using ZfcRbac for managing role-based access control for my ZF2 application. Currently I am controlling the access by updating the guards in zfc_rbac.global.php file in following way.

     'guards' => [
         'ZfcRbac\Guard\RouteGuard' => [
             'p304'             => ['*'],
             'zfcuser/logout'   => ['*'],
             'home'             => ['admin', 'engineer', 'user'],
             'application*'     => ['admin'],
             'AppUser*'         => ['admin'],
             'Clients*'         => ['admin', 'engineer', 'user'],
             'zfcadmin*'        => ['admin'],
             'zfcuser'          => ['admin', 'engineer', 'user'],
             'zfcuser/login'    => ['guest'],
         ]
     ],

I am struggling to find a way to move it to Database. Hope any one can help me to move this access control definition to database.

Muneer
  • 7,384
  • 7
  • 38
  • 62
  • You could easily extend one of the factories, say `ZfcRbac\Factory\ModuleOptionsFactory.php` and add the permissions/roles to the module configuration dynamically. – AlexP Jul 15 '15 at 08:43

1 Answers1

1

If you are using Doctrine as ORM there is already a documentation in ZfcRbac on how to implement this.

danopz
  • 3,310
  • 5
  • 31
  • 42