String permission = ObjectsAccessVerifier.getPermissionFromDocumentState(objectState);
Set hibObjFuncs = hibBIObject.getSbiObjFuncs();
Iterator itObjFunc = hibObjFuncs.iterator();
while (itObjFunc.hasNext()) {
SbiObjFunc aSbiObjFunc = (SbiObjFunc) itObjFunc.next();
SbiFunctions aSbiFunctions = aSbiObjFunc.getId().getSbiFunctions();
String funcTypeCd = aSbiFunctions.getFunctTypeCd();
logger.debug("Folder type [" + funcTypeCd + "]");
if(!funcTypeCd.equalsIgnoreCase("USER_FUNCT")){
logger.debug("Folder id [" + aSbiFunctions.getFunctId() + "]");
logger.debug("Document state [" + objectState + "]");
String rolesHql = "select distinct roles.name from " +
"SbiExtRoles as roles, SbiFuncRole as funcRole " +
"where roles.extRoleId = funcRole.id.role.extRoleId and " +
" funcRole.id.function.functId = " + aSbiFunctions.getFunctId() + " and " +
" funcRole.id.state.valueCd = '" + permission + "' ";
Query rolesHqlQuery = aSession.createQuery(rolesHql);
// get the list of roles that can see the document (in REL or TEST state) in that functionality
List rolesNames = new ArrayList();
rolesNames = rolesHqlQuery.list();