bmcclure / CakePHP-Menu-Plugin

A CakePHP 2.0 plugin designed to help build menus in the controller and display them in the view
MIT License
17 stars 9 forks source link

Menu with ACL #20

Open kalpanvyas opened 10 years ago

kalpanvyas commented 10 years ago

Hi

This plugin looks really good. I am new to cake so please forgive me if this question is silly.

I have followed tutorial from cookbook and my acl is working now. my user is linked to group table with group_id as foreign key. when i tried to use your plugin I couldn't figure out how to tell authField to look for group.name field and match it with permissions array key.

user table: id, username,password,group_id group table: id,name

also normal aro, aco and aros_acos tables exists.

please help

bmcclure commented 10 years ago

I haven't done much CakePHP development recently unfortunately, so I'm going to have to do some digging into the plugin to find out how that might be possible. The menus I've built with this system haven't utilized ACL to determine whether or not to show individual items, but it sounds like that's what you're trying to do, if I'm understanding you correctly. If so, I can look further into it.

kalpanvyas commented 10 years ago

thanks for your reply. I ended up doing it differently. When user logged in I am checking ACL based permission for all controllers and store these permissions in session. In the view "header" looping through session array and based on permission I am currently displaying and hiding menu options. Not sure if this is a correct way but it works.