log-out
1
I have to know if a user belongs to a Group(i.e., Administrator):
var myGroups = security.getUserGroups();
for(var i=1; i <= myGroups.getMaxRowIndex(); i++) {
if(myGroups.getValue(i, 2) == 'Administrators') {
//some code here
break;
}
}
Is there a easier way to do this??
patrick
2
No. That’s the way to do it. You could create a global method isUserInGroup() that takes a group name and does that check.
log-out
3
Thanks…
(Feature Request: new method security.isUserInGroup(userID, GroupName)
)