User privileges

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
malsony
User
Posts: 39

User privileges

Post by malsony »

Is there any way to make sure a user cannot edit the data created by another user of the same user group? Thanks!


mobhar
User
Posts: 11736

Post by mobhar »

User ID Security secures data at record level. Protected tables must have an User ID field for identifying which user a record belongs to. The User ID field names can be different in tables though. When User ID security is enabled, users can only access their own data.

For more information, try to follow "Tutorial - Advanced Security - User ID Security" from the help file.


malsony
User
Posts: 39

Post by malsony »

Oh, thank you! I missed that...

So the user ID field is a must for the tables that I want to make sure one user can modify data created by another, right? Then is there a way to let the system automatically store the value so that the user does not have to fill it everytime? Thanks again!


mobhar
User
Posts: 11736

Post by mobhar »

Yes. You may simply use the related global function CurrentUserID() and assign it to the related field.

For example, in "Add" and "Edit" page, you may write your code in "Row_Inserting" and "Row_Updating" server event respectively:

$rsnew["yourfieldname"] = CurrentUserID();

Alternatively, you may select CurrentUserID() from "Auto-Update Value" under "General" column in Fields setup for "Edit" page. You may also put it in "Default Value" column under "Add Page" in Fields setup for "Add" page.


malsony
User
Posts: 39

Post by malsony »

Thanks for your help!


Post Reply