bjyauthorize

Zend Framework 2 - BjyAuthorize always denies access

邮差的信 提交于 2019-12-30 04:31:28
问题 I have setup the bjyoungblood/bjy-authorize module, but I am currently getting a 403 "access denied" error for each URL except for the one configured in the home route. My module.byjauthorize.global.php looks like following: 'bjyauthorize' => array( 'guards' => array( 'BjyAuthorize\Guard\Controller' => array( array('controller' => 'index', 'action' => 'index', 'roles' => array('guest','user')), array('controller' => 'index', 'action' => 'stuff', 'roles' => array('user')), array('controller' =

Zend2, Zfcuser - automatic logout

柔情痞子 提交于 2019-12-25 10:57:08
问题 I'm working with Zend Framework 2, ZfcUser and BjyAuthorize. Logging in and access control works, but under certain circumstances users get logged out: When they try to navigate to a different page while an on the current page an AJAX call is still running. In Chrome's Network window it shows the AJAX call as cancelled, followed by a call to the page you tried to navigate to, where the following code checks if you're logged in, finds that you're not ( $auth->hasIdentity() returns false ), and

Zend Framework 2 - ZFCUser - How to exclude landing page from auth

≡放荡痞女 提交于 2019-12-24 08:24:58
问题 I'm using ZF2 in combination with ZFCUser and bjyauthorize . I have a landing page which should be globally accessable. All other pages need to be behind a login. At first I blamed bjyauthorize for not letting guest users access my landing page. But after some discussions it seems that ZFCUser is blocking the way. My question is: How can I tell ZFCUser not to block one page/action? Edit: My Application/Module.php looks like in this post. When I add my app myApp to the whitlist, I can access

Give permission for bjyauthorize to run mvc application of ZF2 from CLI

拟墨画扇 提交于 2019-12-22 08:55:06
问题 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

ZF2 - BjyAuthorize - How to Get Rules and Guards from a Database

本秂侑毒 提交于 2019-12-21 02:34:15
问题 I'm using BjyAuthorize with Zend Framework2 to implement authorization and was able to successfully integrate roles from database. Now I want to get my Rules and Guards also from data base tables. How can I do this? 回答1: The easiest method and "the trick" here is really to: Get your rules and guards into the same array format as it is shown in example configuration. So after reading records from the database, in whatever format your raw database data is, process it to match the same guard

No role detected by BjyAuthorize when login

无人久伴 提交于 2019-12-12 12:27:39
问题 I am working with ZF2, Doctrine ORM and BjyAuthorize. The problem is that when I got logged in the method getRoles of the identity returns empty. class User implements UserInterface, ProviderInterface{ /** * @var \Doctrine\Common\Collections\Collection * * @ORM\ManyToMany(targetEntity="Application\Entity\Role", inversedBy="user") * @ORM\JoinTable(name="user_role_linker", * joinColumns={ * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id") * }, * inverseJoinColumns={ * @ORM

Zend Framework2 using Zfcuser & Bjyauthorize routing

只愿长相守 提交于 2019-12-11 20:34:37
问题 I'm a beginer zend framework programmer. I did use ZfcUser for authentification and Bjyauthorize for authorization. I have to type of users : normal users and administrator . So what i want to do is to route the user to page A and admin to page B after authentification . In the Zfcuser configuation file there not this possibility we have just this line 'logout_redirect_route' => 'zfcuser/login', how can do specify a diffrent route for my differents users? 回答1: To me your problem has nothing

ZFCUser and bjyauthorize - How to leave out authorization for landing page

雨燕双飞 提交于 2019-12-11 08:37:53
问题 I'm building a closed website which has a landing page for everyone. I'm using ZfcUser and BjyAuthorize. Everything works now but I wonder how I can exclude my Application's Application\Controller\Index::index action. In my module.bjyauthorize.global.php I told my action to require no authentication: 'BjyAuthorize\Guard\Controller' => array( array( 'controller' => 'Application\Controller\Index', 'action' => 'index', 'roles' => array() ), // ... But still I get forwarded to the ZFCUser login

Give permission for bjyauthorize to run mvc application of ZF2 from CLI

白昼怎懂夜的黑 提交于 2019-12-05 17:36:40
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

zfcuser add user role after registration

久未见 提交于 2019-12-04 13:08:16
问题 I'm using Zend Framework 2 with ZfcUser, BjyAuthorize and Doctrine for the database. Registration etc. works very well so far. My problem is, that registered users have no role assigned, so i want to add the role "user" to the user during registration. I think i could attach this to the "register" event, but i don't know how to do that. I hope someone can help me ... (i used this tutorial for setting up zfcuser etc. http://samminds.com/2013/03/zfcuser-bjyauthorize-and-doctrine-working