dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21672
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10323: Bypassing ACL when getting single objects in Web API. Required for now since to allow interpretat...
------------------------------------------------------------
revno: 10323
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-19 18:09:10 +0100
message:
Bypassing ACL when getting single objects in Web API. Required for now since to allow interpretations of private objects and sharing of private objects with links.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java
dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2013-02-08 04:20:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2013-03-19 17:09:10 +0000
@@ -98,6 +98,14 @@
DataSet getDataSet( String uid );
/**
+ * Returns the DataSet with the given UID. Bypasses the ACL system.
+ *
+ * @param uid the UID.
+ * @return the DataSet with the given UID, or null if no match.
+ */
+ DataSet getDataSetNoAcl( String uid );
+
+ /**
* Returns a DataSets with the given name.
*
* @param name The name.
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java 2013-03-18 18:35:15 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java 2013-03-19 17:09:10 +0000
@@ -505,16 +505,28 @@
{
columnDimensions.add( DATA_X_DIM_ID );
}
+ else
+ {
+ rowDimensions.add( DATA_X_DIM_ID );
+ }
if ( doPeriods )
{
columnDimensions.add( PERIOD_DIM_ID );
}
+ else
+ {
+ rowDimensions.add( PERIOD_DIM_ID );
+ }
if ( doUnits )
{
columnDimensions.add( ORGUNIT_DIM_ID );
}
+ else
+ {
+ rowDimensions.add( ORGUNIT_DIM_ID );
+ }
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java 2013-02-08 07:18:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java 2013-03-19 17:09:10 +0000
@@ -84,6 +84,14 @@
ReportTable getReportTable( String uid );
/**
+ * Retrieves the ReportTable with the given uid. Bypasses the ACL system.
+ *
+ * @param uid the uid of the ReportTable to retrieve.
+ * @return the ReportTable.
+ */
+ ReportTable getReportTableNoAcl( String uid );
+
+ /**
* Retrieves a Collection of all ReportTables.
*
* @return a Collection of ReportTables.
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2013-02-08 04:20:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2013-03-19 17:09:10 +0000
@@ -110,6 +110,11 @@
return i18n( i18nService, dataSetStore.getByUid( uid ) );
}
+ public DataSet getDataSetNoAcl( String uid )
+ {
+ return i18n( i18nService, dataSetStore.getByUidNoAcl( uid ) );
+ }
+
public DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits )
{
DataSet dataSet = getDataSet( id );
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java 2013-03-14 10:12:47 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java 2013-03-19 17:09:10 +0000
@@ -182,6 +182,11 @@
return reportTableStore.getByUid( uid );
}
+ public ReportTable getReportTableNoAcl( String uid )
+ {
+ return reportTableStore.getByUidNoAcl( uid );
+ }
+
public Collection<ReportTable> getReportTables( final Collection<Integer> identifiers )
{
Collection<ReportTable> objects = getAllReportTables();
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java 2013-03-15 17:37:07 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java 2013-03-19 17:09:10 +0000
@@ -329,7 +329,7 @@
protected T getEntity( String uid )
{
- return manager.get( getEntityClass(), uid );
+ return manager.getNoAcl( getEntityClass(), uid ); //TODO consider ACL
}
protected void addAccessProperties( T object )
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2013-03-16 05:57:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2013-03-19 17:09:10 +0000
@@ -636,7 +636,7 @@
can_view=Can view
search_for_user_groups=Search for user groups
object_will_created_public=This object will be created with public edit and view rights
-object_will_created_private=This object will be created private
+object_will_created_private=This object will be private to yourself
#-- Countries / flags ---------------------------------------------------------#
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java 2012-10-18 19:13:26 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java 2013-03-19 17:09:10 +0000
@@ -235,7 +235,7 @@
// Assemble report
// ---------------------------------------------------------------------
- selectedDataSet = dataSetService.getDataSet( ds );
+ selectedDataSet = dataSetService.getDataSetNoAcl( ds );
if ( pe != null )
{