<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Extending Zend_Acl to support custom roles and resources</title>
	<atom:link href="http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html</link>
	<description>Random secrets of PHP, web development</description>
	<lastBuildDate>Sun, 20 Jun 2010 17:42:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Snef</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-41666</link>
		<dc:creator>Snef</dc:creator>
		<pubDate>Wed, 21 Jan 2009 08:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-41666</guid>
		<description>Also, should i only use $acl-&gt;allow and &#039;forget&#039; the $acl-&gt;deny?
Imagine a user (user:1) is bound to group1 and 3.

$acl-&gt;allow(&#039;group:1&#039;, &#039;dummy:foo&#039;);
$acl-&gt;deny(&#039;group:3&#039;, &#039;dummy:foo&#039;);

$this-&gt;isAllowed(&#039;user:1&#039;, &#039;dummy:foo&#039;); // returns false?

Yes, it was denied because of membership of group3, but the user is allowed by membership of group1. So the user should be allowed, isn&#039;t it?

I know, in this example I just could remove the deny rule, but it is just an example!</description>
		<content:encoded><![CDATA[<p>Also, should i only use $acl-&gt;allow and &#8216;forget&#8217; the $acl-&gt;deny?<br />
Imagine a user (user:1) is bound to group1 and 3.</p>
<p>$acl-&gt;allow(&#8216;group:1&#8242;, &#8216;dummy:foo&#8217;);<br />
$acl-&gt;deny(&#8216;group:3&#8242;, &#8216;dummy:foo&#8217;);</p>
<p>$this-&gt;isAllowed(&#8216;user:1&#8242;, &#8216;dummy:foo&#8217;); // returns false?</p>
<p>Yes, it was denied because of membership of group3, but the user is allowed by membership of group1. So the user should be allowed, isn&#8217;t it?</p>
<p>I know, in this example I just could remove the deny rule, but it is just an example!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terra</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-41408</link>
		<dc:creator>Terra</dc:creator>
		<pubDate>Tue, 20 Jan 2009 05:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-41408</guid>
		<description>you make a good point -</description>
		<content:encoded><![CDATA[<p>you make a good point -</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Snef</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-41318</link>
		<dc:creator>Snef</dc:creator>
		<pubDate>Mon, 19 Jan 2009 14:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-41318</guid>
		<description>Hi. I know, it is an old entry but i just got to start playing with it. Solution looks nice but i&#039;m having some trouble to alter the code so that is can work with &#039;group-parenting&#039;.

I want to be able to define groups that inherit from other groups. When a user/group has been found, the parents should also be entered in the acl (like Zend_Acl will work). Ever thought of such a solution?
(It would be nice if it could do both... assigning users to different groups and that the groups could inherit from other groups..)</description>
		<content:encoded><![CDATA[<p>Hi. I know, it is an old entry but i just got to start playing with it. Solution looks nice but i&#8217;m having some trouble to alter the code so that is can work with &#8216;group-parenting&#8217;.</p>
<p>I want to be able to define groups that inherit from other groups. When a user/group has been found, the parents should also be entered in the acl (like Zend_Acl will work). Ever thought of such a solution?<br />
(It would be nice if it could do both&#8230; assigning users to different groups and that the groups could inherit from other groups..)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willem Luijk</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-34716</link>
		<dc:creator>Willem Luijk</dc:creator>
		<pubDate>Fri, 26 Dec 2008 22:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-34716</guid>
		<description>Hi Gergely,

You know roles times resources can grow quite large. Is it in your solution possible to read only the needed combinations when testing if access to a resource need to be evaluated?</description>
		<content:encoded><![CDATA[<p>Hi Gergely,</p>
<p>You know roles times resources can grow quite large. Is it in your solution possible to read only the needed combinations when testing if access to a resource need to be evaluated?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Reynolds</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-29370</link>
		<dc:creator>Tim Reynolds</dc:creator>
		<pubDate>Sun, 07 Dec 2008 16:37:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-29370</guid>
		<description>Nice post. Thank you for the info. Keep it up.</description>
		<content:encoded><![CDATA[<p>Nice post. Thank you for the info. Keep it up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar B. aka the Mover</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-24698</link>
		<dc:creator>Cesar B. aka the Mover</dc:creator>
		<pubDate>Wed, 05 Nov 2008 00:14:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-24698</guid>
		<description>This Blog reminds me the reason I like bloging so much, the interaction is very important with readers and you guys have it right. Looks great too, will be back for more posts, David the mover. : - )</description>
		<content:encoded><![CDATA[<p>This Blog reminds me the reason I like bloging so much, the interaction is very important with readers and you guys have it right. Looks great too, will be back for more posts, David the mover. : &#8211; )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Import from China</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-13325</link>
		<dc:creator>Import from China</dc:creator>
		<pubDate>Sat, 19 Jul 2008 20:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-13325</guid>
		<description>I came across this blog the other day and you got some great info here - thanks.</description>
		<content:encoded><![CDATA[<p>I came across this blog the other day and you got some great info here &#8211; thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ang</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-12893</link>
		<dc:creator>ang</dc:creator>
		<pubDate>Sun, 13 Jul 2008 14:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-12893</guid>
		<description>Very good article, I will try your code into my app that is being developed. Thanx for sharing.</description>
		<content:encoded><![CDATA[<p>Very good article, I will try your code into my app that is being developed. Thanx for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psychic Advice</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-12839</link>
		<dc:creator>Psychic Advice</dc:creator>
		<pubDate>Sat, 12 Jul 2008 14:27:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-12839</guid>
		<description>Thanks for the great info. I hope you&#039;ll follow this with some more great content.</description>
		<content:encoded><![CDATA[<p>Thanks for the great info. I hope you&#8217;ll follow this with some more great content.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Ross</title>
		<link>http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html/comment-page-1#comment-8339</link>
		<dc:creator>Joshua Ross</dc:creator>
		<pubDate>Mon, 05 May 2008 22:06:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.felho.hu/extending-zend_acl-to-support-custom-roles-and-resources.html#comment-8339</guid>
		<description>I find a lot of problems with your assessment of Zend_Acl.  I personally found it to be a robust enough tool to handle a very complicated ACL at my previous company.  Through the use of an Override Assertion I was able to provide the same granular access control as you show without mixing and intermingling the concept of the controller layer with the model layer.  I think you have subverted all the power of the inheritance that is native to Zend_Acl.  The sacrifice of which, I would contend, is a performance hit for which it appears you are implementing extensive caching.  

I would additionally point out that you are incorrect about no resource registry, Zend_Acl itself is a resource registry which contains a role registry object.  

Using an override assertion you only load your Zend_Acl object with roles and resources.  Cache/Serialize that object all you want.  This keeps the object very lightweight and utilizes its inheritance capabilities.  The only time you need granular control is when a user is denied access to a resource.  At that point is when the override assertion would be called and you perform a query to an overrides table using the user&#039;s id instead of the role that was checked against the ACL.  You of course cache the result.  

Using this approach you eliminate all the extensions you wrote and you instead query a model for an override and then check that against the ACL.  All of which can be done in about 10 lines of code.

I would further contend that most forums are comprised of boards containing topics and access control is normally granted to a group(role) to a board(resource) and not at a topic level.  

Although it looks like you put some thought into your approach, I think the better approach is using the built in assertion capability of Zend_Acl.  None the less, I enjoy your blog so keep up the posts!  =]</description>
		<content:encoded><![CDATA[<p>I find a lot of problems with your assessment of Zend_Acl.  I personally found it to be a robust enough tool to handle a very complicated ACL at my previous company.  Through the use of an Override Assertion I was able to provide the same granular access control as you show without mixing and intermingling the concept of the controller layer with the model layer.  I think you have subverted all the power of the inheritance that is native to Zend_Acl.  The sacrifice of which, I would contend, is a performance hit for which it appears you are implementing extensive caching.  </p>
<p>I would additionally point out that you are incorrect about no resource registry, Zend_Acl itself is a resource registry which contains a role registry object.  </p>
<p>Using an override assertion you only load your Zend_Acl object with roles and resources.  Cache/Serialize that object all you want.  This keeps the object very lightweight and utilizes its inheritance capabilities.  The only time you need granular control is when a user is denied access to a resource.  At that point is when the override assertion would be called and you perform a query to an overrides table using the user&#8217;s id instead of the role that was checked against the ACL.  You of course cache the result.  </p>
<p>Using this approach you eliminate all the extensions you wrote and you instead query a model for an override and then check that against the ACL.  All of which can be done in about 10 lines of code.</p>
<p>I would further contend that most forums are comprised of boards containing topics and access control is normally granted to a group(role) to a board(resource) and not at a topic level.  </p>
<p>Although it looks like you put some thought into your approach, I think the better approach is using the built in assertion capability of Zend_Acl.  None the less, I enjoy your blog so keep up the posts!  =]</p>
]]></content:encoded>
	</item>
</channel>
</rss>


