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 |
|---|---|---|
| Abs Mgmt: How can Abs rule pro-rate contractor's last month's entitlement (need help urgently) | PeopleSoft Functional | 03/10/2010 - 9:21pm |
| Can we user LONG datatype as a search option in PeopleSoft | PeopleSoft Technical | 03/10/2010 - 11:22am |
| special caracters are not translated correctly when ftp from windows to unix | Programming | 03/09/2010 - 3:23pm |
| How to view the employees from particular country in peoplesoft? | PeopleSoft Technical | 03/03/2010 - 1:56am |
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