=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java 2014-10-16 06:17:19 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java 2014-10-18 07:31:50 +0000 @@ -28,9 +28,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import com.opensymphony.xwork2.Action; -import org.hisp.dhis.acl.AclService; -import org.hisp.dhis.common.ListMap; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; import org.hisp.dhis.configuration.ConfigurationService; import org.hisp.dhis.dataelement.DataElement; @@ -51,13 +57,7 @@ import org.hisp.dhis.user.User; import org.springframework.beans.factory.annotation.Autowired; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import com.opensymphony.xwork2.Action; /** * @author Lars Helge Overland @@ -119,9 +119,6 @@ } @Autowired - protected AclService aclService; - - @Autowired private ConfigurationService configurationService; // ------------------------------------------------------------------------- @@ -205,9 +202,9 @@ return defaultCategoryCombo; } - private ListMap categoryOptionMap = new ListMap<>(); + private Map> categoryOptionMap = new HashMap>(); - public ListMap getCategoryOptionMap() + public Map> getCategoryOptionMap() { return categoryOptionMap; } @@ -287,13 +284,9 @@ for ( DataElementCategory category : categories ) { - for ( DataElementCategoryOption categoryOption : category.getCategoryOptions() ) - { - if ( aclService.canRead( user, categoryOption ) ) - { - categoryOptionMap.putValue( category.getUid(), categoryOption ); - } - } + List categoryOptions = new ArrayList<>( categoryService.getDataElementCategoryOptions( category ) ); + Collections.sort( categoryOptions, IdentifiableObjectNameComparator.INSTANCE ); + categoryOptionMap.put( category.getUid(), categoryOptions ); } Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );