Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Apigility and ZfcRbac #276

Open
chateaux opened this issue Dec 8, 2014 · 2 comments
Open

Apigility and ZfcRbac #276

chateaux opened this issue Dec 8, 2014 · 2 comments

Comments

@chateaux
Copy link

chateaux commented Dec 8, 2014

Hi -

Quick question, I noticed I was getting some forbidden errors when using the Apigility admin gui and the Modules were not being created as anticipated: http://stackoverflow.com/questions/27365197/zf2-apigility-not-creating-new-api

Turns out the ZfcRbac was causing the problem.

I have included the following in my array:

            //API
            'status.rest.status'        => ['guest'],
            'zf-apigility/ui'              => ['guest'],
            'apigility/ui'                 => ['guest'],
            'zf-apigility/admin'         => ['guest'],

Is there a blanket method to give a third party module full access rights? Or do I need to find out every route that ApiGility uses and include them?

@bakura10
Copy link
Member

bakura10 commented Dec 8, 2014

Ha...

I suppose you are using a guard? I don't know how Apigility works, but isn't there a base root that you could authorize? (like "zf-apigility")?

Also, you could set the policy to "ALLOW" (see here: https://github.com/ZF-Commons/zfc-rbac/blob/master/config/zfc_rbac.global.php.dist#L63) during development, so that if no role is defined for a given route, then it fallback to the protection policy.

@chateaux
Copy link
Author

chateaux commented Dec 9, 2014

You are 100% right.

What I did to resolve this was to create an autoload file: mydev.local.php and to include the following in it:

[ 'protection_policy' => \ZfcRbac\Guard\GuardInterface::POLICY_ALLOW ] Problem solved. thanks! ];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants