I'm trying to use BjyAuthorize in a sample application in ZF2 and I have a bit of an issue setting it up.
I have an Admin
module and I want to give permissions for the user to access it.
I also have the ZfcUser
module and that one seems to work just fine with this acl.
The way I set up the db's is like his:
user_role
role_id default parent
------------------------------
user 1 admin
admin 2 NULL
user_role_linker
user_id role_id
-------------------
1 user
I'm not sure this is set up correctly, also I'm not sure why role_id
is a varchar ??!!
In any case, with this setup the ZfcUser works just fine.
The problem is when I try to use a different module, where I add:
array('controller' => 'Admin\Controller\Index', 'roles' => array('guest','user'))
I get
403 Forbidden You are not authorized to access Admin\Controller\Admin ::indexAction() .
In the README file it is mentioned that I could use $this->isAllowed($resource[, $privilege])
in my controller or view, but that code is wrong and I'm not sure what is the $resource
or the $privilege
So I guess my question is how can I use this module? Did anyone got it to work?