apply user id filter based on security type

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

apply user id filter based on security type

Post by sticcino »

Have a scenario where a table is set to allow all users to view the records.
but if the logged in user secLevel = "contractor", the i want to show only his records.

would applying the one of the following functions do the trick and where would the best event location be? page_load

applyUserIDFilters(CurrentUserID())

or

$Security->addUserID(CurrentUserID())

OR i'm thinking in
UserID_Filtering(&$filter) {
global $Security;

if (user-secuirtyLevel == "contractor")
$filter = "UserId=". CurrentUserID();
}


sticcino
User
Posts: 1043

Post by sticcino »

this worked:

UserID_Filtering(&$filter) {
global $Security;

if (user-secuirtyLevel == "contractor")
$filter = "UserId=". CurrentUserID();
}


mobhar
User
Posts: 11747

Post by mobhar »

sticcino wrote:
where would the best event location be?

Try "Recordset_Selecting" server event. Please read "Server Events and Client Scripts" topic from PHPMaker Help menu for more info and example.


Post Reply