Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken ACL inheritance #1251

Merged
merged 2 commits into from Sep 19, 2013
Merged

Fix broken ACL inheritance #1251

merged 2 commits into from Sep 19, 2013

Conversation

ghost
Copy link

@ghost ghost commented Sep 18, 2013

See #905

phalcon pushed a commit that referenced this pull request Sep 19, 2013
Fix broken ACL inheritance
@phalcon phalcon merged commit dcf9d49 into phalcon:1.3.0 Sep 19, 2013
@ghost ghost deleted the issue-905 branch September 19, 2013 05:24
@swen100
Copy link

swen100 commented Sep 26, 2013

Hi,

tried it out in 1.3.0. This issue is still present! I always get access to ressources which should be denied.

Greetings.

@ghost
Copy link
Author

ghost commented Sep 26, 2013

Could you please post a test case?

@swen100
Copy link

swen100 commented Sep 27, 2013

$acl = new Phalcon\Acl\Adapter\Memory();

//Default action is deny access
$acl->setDefaultAction(Phalcon\Acl::DENY);

//Add "Guests" role to acl
$acl->addRole( new Phalcon\Acl\Role('Guests') );

//Add "Designers" role to acl
$acl->addRole('Designers');

//Define the "Customers" resource
$customersResource = new Phalcon\Acl\Resource('Customers', 'Customers management');

//Add "customers" resource with a couple of operations
$acl->addResource($customersResource, 'search');
$acl->addResource($customersResource, array('create', 'update'));

//Set access level for roles into resources
$acl->allow('Guests', 'Customers', 'search');
$acl->allow('Guests', 'Customers', 'create');
$acl->deny('Guests', 'Customers', 'update');

//Check whether role has access to the operations
echo $acl->isAllowed('Guests', 'Customers', 'edit') . "
"; // should return 0 but returns 1 !!!
echo $acl->isAllowed('Guests', 'Customers', 'update'); // should return 0 but returns 1 !!!

@ghost
Copy link
Author

ghost commented Sep 27, 2013

OK, confirmed, I will file a separate bug report for this case.

@ghost
Copy link
Author

ghost commented Sep 27, 2013

See #1303

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

Successfully merging this pull request may close these issues.

3 participants