The Zend Acl docs show an example on using a custom assertion:
$acl->allow(null, null, null, new MyCustomAssertion());
The problem is that the above code is executed while creating the rules not while checking them. In my controller I can only do something like:
$acl->isAllowed('someUser', 'someResource')
Unlike Zend Rbac the assertion class is already instantiated and I cannot pass it a user ID and post ID to check if the user has access to that post in particular.
Is checking if a user has access to a post from a controller achievable (in a maintainable way) with Zend Acl?
Note 1: I'm not using the Zend framework for this, just the Zend Acl component. Note 2: The reason I'm not using Rbac is because I need the "deny" feature that Acl has and Rbac doesn't.
One way is to create your own implementation of a role and a resource:
Yes, this way you can add this check in a controller using the last line above.