This topic is locked

how can i control the Edit button

8/30/2010 12:11:26 PM
PHPRunner General questions
P
Pkas author

Hi all
I need to control the visibility of the [edit button] in the list view to show depending on user logged.
Where can i edit the code to do this?
Tks

Sergey Kornilov admin 8/31/2010

You can use User Group Permissions for this purpose.

P
Pkas author 8/31/2010



You can use User Group Permissions for this purpose.



tks for your reply.

I could yes, but the problem is the field in table is not a user name(i use the AD name to log). Is a field where accout manager give rights to certain user (only one user).

The AcMan wants to do this on the fly.

At this time, i did a "before process" on [Edit Page] where i can control the display or not of the page depending on that field and if the user do not have the permition are "history.back" for the previous page.
I think it will be more "clean" to edit the code and only show the edit button when they have really access to that record.
Best rgds
Pedro

Sergey Kornilov admin 8/31/2010

I see what you mean.
Here is the article that provides a few examples:

http://xlinesoft.com/phprunner/docs/hide_controls_on_add_edit_pages.htm
Here is the sample code (BeforeDisplay event):

$xt->assign("save_button",$_SESSION["UserID"]=="admin");