return userId;
}
private static Role getVirtualRole(String[] roles) throws Exception {
logger.debug("IN");
Role virtualRole = new Role("", "");
virtualRole.setIsAbleToSaveSubobjects(false);
virtualRole.setIsAbleToSeeSubobjects(false);
virtualRole.setIsAbleToSeeSnapshots(false);
virtualRole.setIsAbleToSeeViewpoints(false);
virtualRole.setIsAbleToSeeMetadata(false);
virtualRole.setIsAbleToSaveMetadata(false);
virtualRole.setIsAbleToSendMail(false);
virtualRole.setIsAbleToSeeNotes(false);
virtualRole.setIsAbleToSaveRememberMe(false);
virtualRole.setIsAbleToSaveIntoPersonalFolder(false);
virtualRole.setIsAbleToBuildQbeQuery(false);
if (roles != null) {
for (int i = 0; i < roles.length; i++) {
String roleName = roles[i];
logger.debug("RoleName="+roleName);
Role anotherRole = DAOFactory.getRoleDAO().loadByName(roleName);
if (anotherRole!=null) {
if (anotherRole.isAbleToSaveSubobjects()) {
logger.debug("User has role " + roleName + " that is able to save subobjects.");
virtualRole.setIsAbleToSaveSubobjects(true);
}
if (anotherRole.isAbleToSeeSubobjects()) {
logger.debug("User has role " + roleName + " that is able to see subobjects.");
virtualRole.setIsAbleToSeeSubobjects(true);
}
if (anotherRole.isAbleToSeeViewpoints()) {
logger.debug("User has role " + roleName + " that is able to see viewpoints.");
virtualRole.setIsAbleToSeeViewpoints(true);
}
if (anotherRole.isAbleToSeeSnapshots()) {
logger.debug("User has role " + roleName + " that is able to see snapshots.");
virtualRole.setIsAbleToSeeSnapshots(true);
}
if (anotherRole.isAbleToSeeMetadata()) {
logger.debug("User has role " + roleName + " that is able to see metadata.");
virtualRole.setIsAbleToSeeMetadata(true);
}
if (anotherRole.isAbleToSaveMetadata()) {
logger.debug("User has role " + roleName + " that is able to save metadata.");
virtualRole.setIsAbleToSaveMetadata(true);
}
if (anotherRole.isAbleToSendMail()) {
logger.debug("User has role " + roleName + " that is able to send mail.");
virtualRole.setIsAbleToSendMail(true);
}
if (anotherRole.isAbleToSeeNotes()) {
logger.debug("User has role " + roleName + " that is able to see notes.");
virtualRole.setIsAbleToSeeNotes(true);
}
if (anotherRole.isAbleToSaveRememberMe()) {
logger.debug("User has role " + roleName + " that is able to save remember me.");
virtualRole.setIsAbleToSaveRememberMe(true);
}
if (anotherRole.isAbleToSaveIntoPersonalFolder()) {
logger.debug("User has role " + roleName + " that is able to save into personal folder.");
virtualRole.setIsAbleToSaveIntoPersonalFolder(true);
}
if (anotherRole.isAbleToBuildQbeQuery()) {
logger.debug("User has role " + roleName + " that is able to build QBE queries.");
virtualRole.setIsAbleToBuildQbeQuery(true);
}
}
}