=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2014-02-03 14:40:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2014-02-19 09:12:17 +0000 @@ -108,6 +108,9 @@ */ @Scanned private Set organisationUnits = new HashSet(); + + @Scanned + private Set dataViewOrganisationUnits = new HashSet(); /** * Set of the dynamic attributes values that belong to this User. @@ -439,6 +442,21 @@ this.organisationUnits = organisationUnits; } + @JsonProperty + @JsonSerialize( contentAs = BaseIdentifiableObject.class ) + @JsonView( { DetailedView.class, ExportView.class } ) + @JacksonXmlElementWrapper( localName = "dataViewOrganisationUnits", namespace = DxfNamespaces.DXF_2_0 ) + @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 ) + public Set getDataViewOrganisationUnits() + { + return dataViewOrganisationUnits; + } + + public void setDataViewOrganisationUnits( Set dataViewOrganisationUnits ) + { + this.dataViewOrganisationUnits = dataViewOrganisationUnits; + } + @JsonProperty( value = "attributeValues" ) @JsonView( { DetailedView.class, ExportView.class } ) @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0) === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml 2012-12-13 11:53:32 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml 2014-02-19 09:12:17 +0000 @@ -63,6 +63,13 @@ foreign-key="fk_userinfo_organisationunitid" /> + + + + + + === modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml' --- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml 2014-01-19 05:53:05 +0000 +++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml 2014-02-19 09:12:17 +0000 @@ -299,6 +299,8 @@ + + === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.java 2013-12-09 18:33:36 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.java 2014-02-19 09:12:17 +0000 @@ -116,6 +116,10 @@ { entityList = new ArrayList( currentUserService.getCurrentUser().getOrganisationUnits() ); } + if ( "true".equals( options.getOptions().get( "userDataViewOnly" ) ) ) + { + entityList = new ArrayList( currentUserService.getCurrentUser().getDataViewOrganisationUnits() ); + } else if ( lastUpdated != null ) { entityList = new ArrayList( manager.getByLastUpdatedSorted( getEntityClass(), lastUpdated ) );