logger.error("No document specified");
return;
}
logger.debug("Input document: id=[" + biobj.getId() + "], name=[" + biobj.getName() + "], label=[" + biobj.getLabel() + "]");
// creates the user profile
IEngUserProfile profile =null;
try{
profile = UserUtilities.getUserProfile(user);
} catch (Exception e) {
logger.error("An error occurred while creating the profile of user [" + user + "]");
throw new SecurityException("An error occurred while creating the profile of user [" + user + "]", e);
}
// Check if the user can execute the document
boolean canSee = ObjectsAccessVerifier.canSee(biobj, profile);
if (!canSee) {
logger.error("Current user cannot execute the required document");
throw new SecurityException("Current user cannot execute the required document");
}
Integer id = biobj.getId();
// get the correct roles for execution
List correctRoles = null;
if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_DEV)
|| profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_USER)
|| profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN))
correctRoles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(id, profile);
else
correctRoles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(id);
logger.debug("correct roles for execution retrived " + correctRoles);
if (correctRoles == null || correctRoles.size() == 0) {