That’s a very useful article Mark,
I have a question:
how can i fetch only the posts those logged in user is permitted to view them?

my solution is :

SELECT * FROM posts WHERE id IN( SELECT foreign_key FROM acos WHERE id IN( SELECT aco_id FROM aros_acos WHERE aro_id=(SELECT id FROM aros WHERE alias=‘Username’) AND aco_id IN (SELECT id FROM acos WHERE model=‘Post’) AND _read=1 )
)

But, i can’t write that sql query with find or paginate function!
can u help me?!

Vahid Alimohamadi on 20/12/09

Very nice code. I had one problem though, similar to what OstReach mentioned on 25/2/09 – if I have controllers with multiple camel cased words in the name (e.g. UserGroupsController, as per the CakePHP naming conventions), then these were not showing up in the menu. I’d already set up the Auth and ACL on my site as per your tutorials.

The problem is that the AppController::buildAcl method will create a node named UserGroups in the ACO table, but the MenuComponent::constructMenu method generates the ACO names using:

$aco = Inflector::underscore($item[‘url’][‘controller’]);

To be consistent with buildAcl, the ACO name should be camel cased and pluralized, not with underscores. The problem can be corrected by changing the above line in MenuComponent::constructMenu to

$aco = Inflector::camelize($item[‘url’][‘controller’]); $aco = Inflector::pluralize($item[‘url’][‘controller’]);

or simply to

$aco = $item[‘url’][‘controller’];

(because Acl->check does not appear to be case sensitive?)

Tim Taylor on 12/1/10

Oops, that should be

$aco = Inflector::camelize($item[‘url’][‘controller’]); $aco = Inflector::pluralize($aco);

towards the end of the last comment (but as I said, $aco = $item[‘url’][‘controller’] will do just as well).

Tim Taylor on 12/1/10

Could you give more details on how to use addMenu, i.e. how to manually control the construction of the menus when autoLoad is set to false? Where should I put the code that calls addMenu and then manually calls loadCache / constructMenu / writeCache?

Thanks!

Tim Taylor on 5/2/10

I tried to set the ‘weight’ key in the $menuOptions of a controller to change the order in which the controllers are listed in the menu. However, this does not work because generateRawMenus() sets the weight to zero regardless of what is in $menuOptions. This can be fixed by changing line 309 of menu.php from:

‘weight’ => 0

to:

‘weight’ => empty($menuOptions[‘weight’]) ? 0 : $menuOptions[‘weight’]

Tim

Tim Taylor on 5/2/10

I’m new with CakePHP, how do display the menu in view?

Thanks

Davi on 25/2/10

please guys
I need help to install menu with acl (aros,acos)

your code doesn’t work :( maybe you have something wrong
thanks I’m waiting for your response

bessimo on 17/3/10

How do you handle users which are not logged in?
I’ve added some items manually but they are only visible when the user is logged in. Am I missing something?

Greg on 9/4/10

Is it working with cakePHP 1.3?

edge on 9/6/10

Mark, Excellent article+component – just what I needed…

You have a typo/link-missing in the second para of ‘How Do I Use It?’. It looks like ‘alternate component declarations’ should be a link…

Thanks again!

-Craig

Craig on 21/6/10

Almost all sports require some sort of physical strength and endurance. It is believed that all professional body builders have taken anabolic steroids to get where they are. Next to bodybuilding, football is very high among steroid users. Whether it is to gain muscle, or lose weight, anabolic steroids are used in several sports. buy anabolics
Special Prices And Discounts We offer special prices and discounts for all large quantity purchases.

U.Tozzi 2 days, 1 hour ago

1 2 next >