Hi Dominik

Unfortunately, this was the best thing i could find and what i implemented
in the end

In case of the assertion where i want to verify if someone is the owner of a
resource i did these things:

* I created a ResourceWithOwnerInterface that demands a method getOwnerId()
* Any entity that needed this assertion implements that interface and with
that an implementation of getOwnerId() that can determine who the owner is
* I then added the following methods to the entity:



(askAcl is a method in an abstract entity that is extended which takes care
of getting the identity/role and acl from the servicelocator and then
ultimately does $acl->isAllowed($identity, $resource, $action); -> $resource
being the $this parameter and $action being "view"/"edit"
* The assertion that is being called can then perform the followin check:



If that boolean is true, then getOwnerId() can be safely called.

I'm still not happy with this solution though, for reasons i gave earlier.
domeb wrote
> Hey Martijn,
> 
> did you get a better solution right now? Have the same problems and cant
> find a better way to do it, but it feels weird... 
> 
> regards 
> Dominik





--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/zf2-zend-acl-dynamic-assertions-when-how-to-load-the-resource-tp4660933p4662339.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to