判断当前用户在当前程序中是否拥有某角色的权限:
var user = getWebUser();//获取当前登陆用户
var roles = user.getRoles();//获取当前登录用户的角色集合
var rtn=false;
var currentApplicationid =getApplication();
for(var it = roles.iterator();roles!=null && it.hasNext();)
{
var role = it.next();
if(currentApplicationid.equals(role.getApplicationid()))
{
if(role.getName()=="行政助理" || role.getName()=="管理员")
{
rtn=true;
}
}
}
rtn;