Hi,
I would like to know how can I get the role admitted for a page to show a message telling user he has not privilege to access page:
public boolean function userValidator(struct rule,any messagebox, any controller){
var isAllowed = false;
var user = getUserSession();
var cPermission = “”;
if( !isNull(user) ){
// verify user has role
for(var x=1; x<=listLen(arguments.rule[‘roles’]); ++x){
if( listFindNoCase(user.getRolesList(),listGetAt(arguments.rule[‘roles’],x)) ){
return true;
}
}
}
return isAllowed;
}
How can I call this function with the rule from a page?