<?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>Tue, 09 Mar 2010 23:55:11 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<item>
		<title>By: Neil Crookes</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-6263</link>
		<dc:creator>Neil Crookes</dc:creator>
		<pubDate>Sun, 22 Nov 2009 19:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-6263</guid>
		<description>@Ken, yes it does require your User model to “actAs” ACL. The node() function requires the id property of the User model set. You could do it outside the permissions() function if you wanted.</description>
		<content:encoded><![CDATA[<p>@Ken, yes it does require your User model to “actAs” ACL. The node() function requires the id property of the User model set. You could do it outside the permissions() function if you wanted.</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-6260</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Sun, 22 Nov 2009 15:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-6260</guid>
		<description>Does this require your User model to &quot;actAs&quot; ACL (behaviour)?
I&#039;m asking only because i&#039;m not sure , but i see the node() function call.

Also, if it works based on the node, why do you need the $userId to be passed to the function ?

thanks,
Ken.</description>
		<content:encoded><![CDATA[<p>Does this require your User model to &#8220;actAs&#8221; ACL (behaviour)?<br />
I&#8217;m asking only because i&#8217;m not sure , but i see the node() function call.</p>
<p>Also, if it works based on the node, why do you need the $userId to be passed to the function ?</p>
<p>thanks,<br />
Ken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Badkas</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-3656</link>
		<dc:creator>Amit Badkas</dc:creator>
		<pubDate>Fri, 26 Jun 2009 12:02:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-3656</guid>
		<description>Neil,

&quot;@mark, patch onit’s way soon, as soon as I get internet up and running in my new house.&quot;

When will this happen? I need patch desperately too :)

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Neil,</p>
<p>&#8220;@mark, patch onit’s way soon, as soon as I get internet up and running in my new house.&#8221;</p>
<p>When will this happen? I need patch desperately too :)</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-2228</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Mon, 11 May 2009 18:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-2228</guid>
		<description>You could just use this to get the permissions:

function permissions($userId) {
		 return $this-&gt;Acl-&gt;Aro-&gt;find(&#039;threaded&#039;,array(&#039;conditions&#039;=&gt;array(&#039;Aro.foreign_key&#039;=&gt;$userId)));
	}

It seems to be a little simpler than that huge statement</description>
		<content:encoded><![CDATA[<p>You could just use this to get the permissions:</p>
<p>function permissions($userId) {<br />
		 return $this-&gt;Acl-&gt;Aro-&gt;find(&#8216;threaded&#8217;,array(&#8216;conditions&#8217;=&gt;array(&#8216;Aro.foreign_key&#8217;=&gt;$userId)));<br />
	}</p>
<p>It seems to be a little simpler than that huge statement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CakePHP Digest #9 - The One Where I Steal Everyone&#8217;s Ideas &#124; PseudoCoder.com</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-595</link>
		<dc:creator>CakePHP Digest #9 - The One Where I Steal Everyone&#8217;s Ideas &#124; PseudoCoder.com</dc:creator>
		<pubDate>Thu, 12 Mar 2009 02:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-595</guid>
		<description>[...] Crookes posted a query that will grab all the ACL permissions at once. Be warned, this query is not for the faint of heart. It feeds on three whole cows a day [...]</description>
		<content:encoded><![CDATA[<p>[...] Crookes posted a query that will grab all the ACL permissions at once. Be warned, this query is not for the faint of heart. It feeds on three whole cows a day [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-03-10 &#171; Richard@Home</title>
		<link>http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/comment-page-1/#comment-584</link>
		<dc:creator>links for 2009-03-10 &#171; Richard@Home</dc:creator>
		<pubDate>Wed, 11 Mar 2009 05:15:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-584</guid>
		<description>[...] Neil Crookes » Get ALL ACL permissions (tags: cakephp acl)   Possibly related posts: (automatically generated)links for 2009-01-15Media types in css serve up tags for print or handheld devicesAdv. Scripting - Week 2My daily readings 05/11/2008 [...]</description>
		<content:encoded><![CDATA[<p>[...] Neil Crookes » Get ALL ACL permissions (tags: cakephp acl)   Possibly related posts: (automatically generated)links for 2009-01-15Media types in css serve up tags for print or handheld devicesAdv. Scripting &#8211; Week 2My daily readings 05/11/2008 [...]</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-579</link>
		<dc:creator>Neil Crookes</dc:creator>
		<pubDate>Tue, 10 Mar 2009 21:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.neilcrookes.com/?p=172#comment-579</guid>
		<description>Hey Andy, cheers for the comment. I&#039;ll check out your query as soon as I get into to work tomorrow. Looks promising though.

I know what you mean about the sentence about the self joins - what you said is what I meant - 3 self joins with full table scan for each, so the result set the where conditions are applied to is essentially, the number of records in the table to the power of the levels in the Aco hierarchy. Ouch. The work done to improve this - does it involve moving the conditions into the joins?

Any other cool stuff coming in 1.3 that you can share exclusively on my blog?</description>
		<content:encoded><![CDATA[<p>Hey Andy, cheers for the comment. I&#8217;ll check out your query as soon as I get into to work tomorrow. Looks promising though.</p>
<p>I know what you mean about the sentence about the self joins &#8211; what you said is what I meant &#8211; 3 self joins with full table scan for each, so the result set the where conditions are applied to is essentially, the number of records in the table to the power of the levels in the Aco hierarchy. Ouch. The work done to improve this &#8211; does it involve moving the conditions into the joins?</p>
<p>Any other cool stuff coming in 1.3 that you can share exclusively on my blog?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
