Thursday, November 28, 2013

Roles in XPages - Part ||

I have tried obtaining user roles using different methods before. I think the following way is pretty simple to obtian an array or user roles and a comma separated string of user roles

var userRolesArray=database.getACL().getRoles().toArray()

var userRolesString="";

for (itr=0;itr
{ userRolesString+=userRolesArray[itr]+",";
}

userRolesString;

My previous post on this topic can be navigated to by clicking on the following link

1 comment:

  1. database.queryAccessRoles(session.getEffectiveUserName()).contains('[Admin]') also seems fitting

    ReplyDelete