A very handy PeopleCode function to check for a user role(s) and perform specific actions depending on the value returned.
| Title | Under | Posted on |
|---|---|---|
| nVision Tabular Report through PIA with prompts | PeopleSoft Technical | 02/02/2012 - 10:07pm |
| Can we create an AE to mass update Position - Jobcode data? | PeopleSoft Technical | 01/18/2012 - 3:11am |
| Pay Components on job data can be defaulted and setup based on the rules? | PeopleSoft Functional | 01/05/2012 - 4:58am |
| PSFT Authentication token failed for Node PSFT_HR | PeopleSoft Technical | 01/03/2012 - 12:21am |
Comments
There also exists a PeopleCode function "IsUserInRole" (and also "IsUserInPermissionList").
Bart, thanks for pointing out the functions. I guess this will shrink the above code to 1 line! And to follow up on your comment here is the syntax and little explanation for each of the functions.
IsUserInRole
IsUserInRole(rolename1 [, rolename2]. . .)
Returns True if the current user belongs to one or more role specified in the role array, otherwise it returns false.
IsUserInPermissionList
IsUserInPermissionList(PermissionList1 [, PermissionList2]. . .)
Returns True if the current user has access to one or more permission list specified in the passed array, otherwise it returns false.
Thanks again Bart!
Yes, I agree tht IsUserInRole is a very handy function.
I've used it as given below:
If (&PrevAct = "LOA" And
ACTION <> "RFL") And
Not (IsUserInRole("MBT_JOB_SUPERUSER_VALIDATION")) Then
Error (MsgGetText(20000, 533, ""));
End-If;
Post new comment