Source:
<code>public boolean chkAuthorization(String userName, Object conceptCollectionObj, String[] userRoles) throws QuadrigaStorageException, QuadrigaAccessException { IConceptCollection collection; <START> String conceptCollectionId = null; <END> if (conceptCollectionObj instanceof String) { conceptCollectionId = (String) conceptCollectionObj; collection = conceptCollectionManager.getConceptCollection(conceptCollectionId); } else { try { collection = (IConceptCollection) conceptCollectionObj; } catch (ClassCastException cce) { throw new IllegalObjectException(cce); } } String conceptCollectionOwner = collection.getOwner().getUserName(); if (userName.equals(conceptCollectionOwner)) { return true; } if (userRoles.length == 0) { return false; } List<String> roles = Arrays.asList(userRoles); List<IConceptCollectionCollaborator> ccCollaboratorList = conceptCollectionManager .showCollaboratingUsers(conceptCollectionId); if (ccCollaboratorList == null || ccCollaboratorList.isEmpty()) return false; for (IConceptCollectionCollaborator ccCollaborator : ccCollaboratorList) { String collaboratorName = ccCollaborator.getCollaborator().getUserObj().getUserName(); if (userName != null) { if (userName.equals(collaboratorName)) { List<IQuadrigaRole> collaboratorRoles = ccCollaborator.getCollaborator().getCollaboratorRoles(); if (collaboratorRoles != null) { for (IQuadrigaRole collabRole : collaboratorRoles) { String collaboratorRoleId = collabRole.getId(); if (roles != null) { if (roles.contains(collaboratorRoleId)) { return true; } } } } } } } return false; }</code><technical_language>above. please pay more attention flow variable is set</technical_language>

Target:
public boolean chkAuthorization(String userName, Object conceptCollectionObj, String[] userRoles) throws QuadrigaStorageException, QuadrigaAccessException { IConceptCollection collection; if (conceptCollectionObj instanceof String) { String conceptCollectionId = (String) conceptCollectionObj; collection = conceptCollectionManager.getConceptCollection(conceptCollectionId); } else { try { collection = (IConceptCollection) conceptCollectionObj; } catch (ClassCastException cce) { throw new IllegalObjectException(cce); } } String conceptCollectionOwner = collection.getOwner().getUserName(); if (userName.equals(conceptCollectionOwner)) { return true; } if (userRoles.length == 0) { return false; } List<String> roles = Arrays.asList(userRoles); List<IConceptCollectionCollaborator> ccCollaboratorList = conceptCollectionManager .showCollaboratingUsers(collection.getConceptCollectionId()); if (ccCollaboratorList == null || ccCollaboratorList.isEmpty()) { return false; } for (IConceptCollectionCollaborator ccCollaborator : ccCollaboratorList) { String collaboratorName = ccCollaborator.getCollaborator().getUserObj().getUserName(); if (userName != null) { if (userName.equals(collaboratorName)) { List<IQuadrigaRole> collaboratorRoles = ccCollaborator.getCollaborator().getCollaboratorRoles(); if (collaboratorRoles != null) { for (IQuadrigaRole collabRole : collaboratorRoles) { String collaboratorRoleId = collabRole.getId(); if (roles != null) { if (roles.contains(collaboratorRoleId)) { return true; } } } } } } } return false; }