<?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: Get ALL ACL permissions</title>
	<atom:link href="http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/</link>
	<description>Learnings and Teachings on Web Application Development &#38; CakePHP</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:44:06 +0100</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Luc</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-18979</link>
		<dc:creator>Luc</dc:creator>
		<pubDate>Thu, 15 Dec 2011 13:55:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-18979</guid>
		<description>@Neil: I have solved the problem I posted before. I have updated the AppHelper::hasPermission for version 2.0.

@cesar: I see the same problem. When you first allow and then deny on a lower level (controller/action) then it still gives the denied nodes as allowed.
Does anyone have a solution for this.

Regards,

Luc</description>
		<content:encoded><![CDATA[<p>@Neil: I have solved the problem I posted before. I have updated the AppHelper::hasPermission for version 2.0.</p>
<p>@cesar: I see the same problem. When you first allow and then deny on a lower level (controller/action) then it still gives the denied nodes as allowed.<br />
Does anyone have a solution for this.</p>
<p>Regards,</p>
<p>Luc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luc</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-18397</link>
		<dc:creator>Luc</dc:creator>
		<pubDate>Fri, 25 Nov 2011 14:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-18397</guid>
		<description>Hi,
I tried to implement this in CakePHP 2.0 but I get the following error:
Fatal error: Call to a member function hasPermission() on a non-object in ...

In my View I have this:

if ($this-&gt;App-&gt;hasPermission(&#039;/admin/groups&#039;) == true) {
	...
}


and my AppHelper looks like this:

App::uses(&#039;Helper&#039;, &#039;View&#039;);
class AppHelper extends Helper {
	function hasPermission($url) {
		...
	}
}

Can you tell me what I did wrong?

Thanx in advance.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I tried to implement this in CakePHP 2.0 but I get the following error:<br />
Fatal error: Call to a member function hasPermission() on a non-object in &#8230;</p>
<p>In my View I have this:</p>
<p>if ($this-&gt;App-&gt;hasPermission(&#8216;/admin/groups&#8217;) == true) {<br />
	&#8230;<br />
}</p>
<p>and my AppHelper looks like this:</p>
<p>App::uses(&#8216;Helper&#8217;, &#8216;View&#8217;);<br />
class AppHelper extends Helper {<br />
	function hasPermission($url) {<br />
		&#8230;<br />
	}<br />
}</p>
<p>Can you tell me what I did wrong?</p>
<p>Thanx in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxime</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-14472</link>
		<dc:creator>Maxime</dc:creator>
		<pubDate>Thu, 23 Jun 2011 08:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-14472</guid>
		<description>If we are 2 controllers which names starts with same string, the (big) request return wrong permission.

-&gt; For good results : add &quot;/&quot; on last line just behind % like :

ON tmp_aco.id=tt.aco_id OR tmp_aco.alias like concat(tt.name,&#039;/%&#039;)</description>
		<content:encoded><![CDATA[<p>If we are 2 controllers which names starts with same string, the (big) request return wrong permission.</p>
<p>-&gt; For good results : add &#8220;/&#8221; on last line just behind % like :</p>
<p>ON tmp_aco.id=tt.aco_id OR tmp_aco.alias like concat(tt.name,&#8217;/%&#8217;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-14243</link>
		<dc:creator>Cesar</dc:creator>
		<pubDate>Wed, 15 Jun 2011 16:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-14243</guid>
		<description>the query not works too in the situation when I give some permissions on group but deny some cascade permission on the user.
Example: accept Users to group1 but deny group1:user1 to edit in Users. dont works.
thanks.</description>
		<content:encoded><![CDATA[<p>the query not works too in the situation when I give some permissions on group but deny some cascade permission on the user.<br />
Example: accept Users to group1 but deny group1:user1 to edit in Users. dont works.<br />
thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-14219</link>
		<dc:creator>Cesar</dc:creator>
		<pubDate>Tue, 14 Jun 2011 21:08:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-14219</guid>
		<description>sorry...
some corrections on last lines.
...wrong results...
...retrieve the correct permissions from aros_acos...
sorry.</description>
		<content:encoded><![CDATA[<p>sorry&#8230;<br />
some corrections on last lines.<br />
&#8230;wrong results&#8230;<br />
&#8230;retrieve the correct permissions from aros_acos&#8230;<br />
sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-14218</link>
		<dc:creator>Cesar</dc:creator>
		<pubDate>Tue, 14 Jun 2011 21:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-14218</guid>
		<description>Amazing work.

I tested the case when I have groups of users. When I add the group permissions, all users of that group (with this own aro_id) was resolved. well done.

but, when i tested again its own rights on acos_aros table, when I define it against their fields: _create,_read,_update,_delete, works that way: defining at least one of them with 1, gets its permissions, but allowing and denying each of them(0 on _create, but 1on _read) give me worng results.
so, how can retrive correct permissions from acos_aros definitions?
thanks.</description>
		<content:encoded><![CDATA[<p>Amazing work.</p>
<p>I tested the case when I have groups of users. When I add the group permissions, all users of that group (with this own aro_id) was resolved. well done.</p>
<p>but, when i tested again its own rights on acos_aros table, when I define it against their fields: _create,_read,_update,_delete, works that way: defining at least one of them with 1, gets its permissions, but allowing and denying each of them(0 on _create, but 1on _read) give me worng results.<br />
so, how can retrive correct permissions from acos_aros definitions?<br />
thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bancer</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-9375</link>
		<dc:creator>bancer</dc:creator>
		<pubDate>Mon, 19 Jul 2010 16:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-9375</guid>
		<description>That query is really impressive! Unfortunately, it returns an empty array on deeper groups hierarchy. I tested it with &quot;Group1 -&gt; Group2 -&gt; User3&quot; and it returned an empty array. But for &quot;Group1 -&gt; User2&quot; the query does a perfect job. I&#039;ve never thought it is possible to achieve such amazing results with SQL.</description>
		<content:encoded><![CDATA[<p>That query is really impressive! Unfortunately, it returns an empty array on deeper groups hierarchy. I tested it with &#8220;Group1 -&gt; Group2 -&gt; User3&#8243; and it returned an empty array. But for &#8220;Group1 -&gt; User2&#8243; the query does a perfect job. I&#8217;ve never thought it is possible to achieve such amazing results with SQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-6381</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Sun, 06 Dec 2009 09:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-6381</guid>
		<description>@Neil: Yep your lead was right on!
That&#039;s exactly what i did... 

AppController::isAuthorized() is much like your &quot;hasPermissions&quot;.. only it returns the &quot;in_array&quot; of your $this-&gt;params[&#039;controller&#039;] with $this-&gt;params[&#039;action&#039;] - and not based on parameters sent to it.

This effectively reducded the amount of SQL&#039;s for permissions to a single huge query upon login and eliminated the 3 queries that were ran upon each page load.
Well worth it when someone travels in the site a lot.

Thanks for everything, your blog has been a tremendous source of help!</description>
		<content:encoded><![CDATA[<p>@Neil: Yep your lead was right on!<br />
That&#8217;s exactly what i did&#8230; </p>
<p>AppController::isAuthorized() is much like your &#8220;hasPermissions&#8221;.. only it returns the &#8220;in_array&#8221; of your $this-&gt;params['controller'] with $this-&gt;params['action'] &#8211; and not based on parameters sent to it.</p>
<p>This effectively reducded the amount of SQL&#8217;s for permissions to a single huge query upon login and eliminated the 3 queries that were ran upon each page load.<br />
Well worth it when someone travels in the site a lot.</p>
<p>Thanks for everything, your blog has been a tremendous source of help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Crookes</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-6289</link>
		<dc:creator>Neil Crookes</dc:creator>
		<pubDate>Wed, 25 Nov 2009 20:27:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-6289</guid>
		<description>@Ken, I&#039;m sure it could. The cook book implies you could set the AuthComponent::authorize property to &#039;controller&#039; then have a AppController::isAuthorized() method that could check the session. Let me know how you get on.</description>
		<content:encoded><![CDATA[<p>@Ken, I&#8217;m sure it could. The cook book implies you could set the AuthComponent::authorize property to &#8216;controller&#8217; then have a AppController::isAuthorized() method that could check the session. Let me know how you get on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-6288</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Wed, 25 Nov 2009 15:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-6288</guid>
		<description>@Neil, Thank i got it working.. it works great!

Also, i was wondering if this can somehow be used to remove the ACL checks that are ran at each page load (The ACL SQL queries) - since we loaded all the permissions into the Session.. it is somehow possible to override the check process to try the session first?

I know the main purpose of loading them into the session is for the views, but maybe it can also be used to cut down on those queries that run on each page... thus giving this massive query even more credit

Like to hear your thoughts.

Thanks, Ken.</description>
		<content:encoded><![CDATA[<p>@Neil, Thank i got it working.. it works great!</p>
<p>Also, i was wondering if this can somehow be used to remove the ACL checks that are ran at each page load (The ACL SQL queries) &#8211; since we loaded all the permissions into the Session.. it is somehow possible to override the check process to try the session first?</p>
<p>I know the main purpose of loading them into the session is for the views, but maybe it can also be used to cut down on those queries that run on each page&#8230; thus giving this massive query even more credit</p>
<p>Like to hear your thoughts.</p>
<p>Thanks, Ken.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

