This topic is locked

'Create Menu Item' only for Admin

7/15/2005 6:02:03 AM
PHPRunner General questions
jpedwardspost author

Hi,
Is it possible to restrict the 'Menu Item' for a table only for the Admin user. This would be useful when you need to give the 'default' users permission to add, delete, edit records in a table but only when it is part of a Master Detail Input Screen but you don't want them to be able to edit it directly (ie when it is not being driven by a master record).
I need Admin to be able to edit certain tables directly but not the general users.
I was thinking mabe a 'Admin Only' check box next to the

'Create Menu Item for this table' or perhaps add 'menu items' as objects that be controlled by group/user permissions.
Cheer,

JP

Sergey Kornilov admin 7/18/2005

Hi,
you can modify your generated pages to remove menu items for certain tables and users.

Open generated menu.php file wit a text editor, find a GetTables fuction. It will look like:

function GetTables($sUserName)

{

switch($sUserName)

{

case "bob":

 return  array("cars","make");

...



To disable menu item creation for user boband table make, modify it this way:

function GetTables($sUserName)

{

switch($sUserName)

{

case "bob":

 return  array("cars");

...


Then open each of ..._functions.php files, find GetTables function and modify it the same way.

jpedwardspost author 7/18/2005

Thanks,
I'll give this a try.
You know, a 'hints, tips and tricks' page for just this sort of thing would be good.
Cheers,

JP