Hey All

I'm trying to get a mapping action to determine if a user is in a
particular role via a regex match.

My current code looks like this :


//set local variables Grab Roles user is currently in
var myRoles = Array(RoleVault.getRolesUserIn(recipient));

// set the selected application as the variable for searching
var str1 = flowdata.get('start/request_form/ApplicationRoles');

//regex string for contains
var str2 = "/.*";
var str3 = ".*/";

//should result in /.*application.*/ as the regex string
var regexp = str2+str1+str3;

//loop through array search for matches
for (var i = 0; i < myRoles.length; i++) {

The issue is that i get in the logs TypeError: match is not a function.

I've tried adding to another variable:

var myresult = myroles[i]

I'm still getting the same results in the error logs.

Anything obvious i'm missing? is there perhaps a nicer way of doing



AAG885's Profile: https://forums.netiq.com/member.php?userid=1750
View this thread: https://forums.netiq.com/showthread.php?t=56019