coolcsn / CsnAuthorization

Authorization module for Zend Framework 2
BSD 3-Clause "New" or "Revised" License
13 stars 15 forks source link

'Role 'guest' not found' #8

Closed juarezelias closed 10 years ago

juarezelias commented 10 years ago

when the CsnAuthorization is enabled the follow error occours:


[500]: /user - Uncaught exception 'Zend\Permissions\Acl\Exception\InvalidArgumentException' with message 'Role 'guest' not found' in /Library/WebServer/Documents/testes/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/Registry.php:106 Stack trace:

0 /Library/WebServer/Documents/testes/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Acl.php(722): Zend\Permissions\Acl\Role\Registry->get('guest')

1 /Library/WebServer/Documents/testes/vendor/coolcsn/csn-authorization/src/CsnAuthorization/Module.php(59): Zend\Permissions\Acl\Acl->isAllowed('guest', 'CsnUser\Control...', 'index')

2 [internal function]: CsnAuthorization\Module->onRoute(Object(Zend\Mvc\MvcEvent))

3 /Library/WebServer/Documents/testes/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

4 /Library/WebServer/Documents/testes/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerLi in /Library/WebServer/Documents/testes/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/Registry.php on line 106


Anyone can help me ?

coolcsn commented 10 years ago

If you are using a DB for "CsnAuthorization" nake sure you have imported the sample data. Just check in the table "role" and make sure there is a role "guest". If you don't use the DB make sure you have in /config/autoload/acl.global.config.php and there is a role "guest" declared in the section with the roles.

juarezelias commented 10 years ago

Thanks !!! Ive verified DB and change the name collums to lowcase and now its work fine.