I have a completely running mvc application on ZF2. I want to run some actions from command line. I have properly set up my console routes and other environments. When I run my app from CLI, I got Permission denied exception like this:
'You are not authorized to access GeneratePdf\Controller\GeneratePdf\GeneratePdf:generate-all' in /var/www/zf2-reporting/module/BjyAuthorize/src/BjyAuthorize/Guard/Controller.php:172
I already have some user in my database. How can I use those credentials to authorize a CLI user to run Actions?
Edit:
Following is the guards array in bjyauthorize.global.php for mentioned controller.
'guards' => array(
'BjyAuthorize\Guard\Controller' => array(array('controller' => 'GeneratePdf\Controller\GeneratePdf', 'roles' => array('admin', 'letters_admin'))
I have used ZfcUser as well. How can I pass user login credentials from CLI. Or if there is any way to use user session from cli.
Thanks