This topic is locked

version 7 menus based on permissions

1/26/2014 2:44:53 PM
PHPRunner General questions
W
wfcentral author

I would like to use the new menu builder in version 7 to layout custom menus for different permission users.
Example
Admin, Manager, Employee
then only show that menu based on the permissions of the logged in user.
I'm assuming I can do this through the events - any help would be appreciated.

Sergey Kornilov admin 1/26/2014

This is how it works by default, no coding required. Each user only sees those tables that she can access as per User Group Permissions.

W
wfcentral author 1/26/2014



This is how it works by default, no coding required. Each user only sees those tables that she can access as per User Group Permissions.


I understand that - guess I did not make myself clear.
In version 6 I have a project that has menu items in groups. It's a bit complicated... but let's say there is a group called "Time Entries" and it is for employees - there may be 5 items in that group that the employees use. Then, the Manager wanted me to setup a group for him called "Management" and it has a mix of items in it (some that the employees actually have access to). As such, the employees see this tab that says "Management."
So, I have gone into the event area and done code to hide tabs from certain users. It is a pain.
I was hoping in version 7 I could just create 3 different menu setups and then hide that entire menu (groups, sub-items, etc) from certain users.

Sergey Kornilov admin 1/28/2014

Sorry, I still don't understand why you cannot use User Group Permissions for this purpose. It was designed for this specific scenario. If you use don't have right to access certain table - it won't be shown on the menu. If user don't have permissions to access the whole menu group - it will not be shown as well.

W
wfcentral author 1/30/2014



Sorry, I still don't understand why you cannot use User Group Permissions for this purpose. It was designed for this specific scenario. If you use don't have right to access certain table - it won't be shown on the menu. If user don't have permissions to access the whole menu group - it will not be shown as well.


It's hard to explain, but there are scenarios where they do have permission to see a table if they have accessed it through the proper parent/child links - however, we do not want them accessing that page directly and seeing the content outside the parent/child relationship.
At the same time the admin DOES want to see that information.
I will try some other way to do it... I just thought with the addition of these separate menus in version 7 it would make it simple for me.

Sergey Kornilov admin 1/31/2014

Additional menus are for display purposes only, the permissions to access certain table are still determined based on User Group Permissions.
I do understand the idea. For instance you have Order Details table that nobody needs to see on the menu except the admin (all others only need to see it as Details table or Orders).
Check this article: http://xlinesoft.com/phprunner/docs/menu_item_modify.htm

Example #2

A
Abul 1/31/2014



Additional menus are for display purposes only, the permissions to access certain table are still determined based on User Group Permissions.
I do understand the idea. For instance you have Order Details table that nobody needs to see on the menu except the admin (all others only need to see it as Details table or Orders).
Check this article: http://xlinesoft.com/phprunner/docs/menu_item_modify.htm

Example #2


@Admin,

I followed the example you mentioned and it's works nice. But I would like to do the same by using built-in "Menu Builder" feature without events. Is it possible? Say, I can create different menus for different group of users by Menu Builder but I can not see the function after building my app. Thanks.

Sergey Kornilov admin 1/31/2014

Different menus in Menu Builder are just visual elements. If you need to hide/show menus based on certain rules you either need to use User Group Permissions or events or both.