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

Acl callback assertion #7328

Closed
wants to merge 6 commits into from
Closed

Acl callback assertion #7328

wants to merge 6 commits into from

Conversation

kanellov
Copy link
Contributor

Like the Rbac callback assertion proposed in #7327, I've implemented an ACL Callback assertion class. Here is an example of use:

<?php
use Zend\Permissions\Acl\Acl;
use Zend\Permissions\Acl\Assertion\Callback;

$validIps = array(
    10.10.10.10,
);
$acl = new Acl();
$assertion = new Callback(function ($acl, $role, $resource, $privilege) use ($validIps) {
    return in_array($_SERVER['REMOTE_ADDR'], $validIps);
});
$acl->allow(null, null, null, $assertion);  

@weierophinney weierophinney added this to the 2.4.0 milestone Mar 17, 2015
weierophinney added a commit that referenced this pull request Mar 17, 2015
weierophinney added a commit that referenced this pull request Mar 17, 2015
@weierophinney
Copy link
Member

Merged to develop for release with 2.4.

@kanellov kanellov deleted the feature/acl_callback_assertion branch March 23, 2015 10:24
weierophinney added a commit to zendframework/zend-permissions-acl that referenced this pull request May 15, 2015
…ture/acl_callback_assertion

Acl callback assertion
weierophinney added a commit to zendframework/zend-permissions-acl that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants