← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18047: Resource tables. Getting all sql views with no ACL when dropping / recreating.

 

------------------------------------------------------------
revno: 18047
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-01-19 11:46:09 +0100
message:
  Resource tables. Getting all sql views with no ACL when dropping / recreating.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.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/sqlview/SqlViewService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java	2015-01-19 10:46:09 +0000
@@ -64,6 +64,8 @@
     SqlView getSqlView( String viewName );
 
     Collection<SqlView> getAllSqlViews();
+    
+    Collection<SqlView> getAllSqlViewsNoAcl();
 
     String makeUpForQueryStatement( String query );
 

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2015-01-19 10:46:09 +0000
@@ -520,7 +520,7 @@
     @Override
     public void createAllSqlViews()
     {
-        List<SqlView> sqlViews = new ArrayList<>( sqlViewService.getAllSqlViews() );
+        List<SqlView> sqlViews = new ArrayList<>( sqlViewService.getAllSqlViewsNoAcl() );
         Collections.sort( sqlViews, IdentifiableObjectNameComparator.INSTANCE );
 
         for ( SqlView sqlView : sqlViews )
@@ -533,7 +533,7 @@
     @Override
     public void dropAllSqlViews()
     {
-        List<SqlView> views = new ArrayList<>( sqlViewService.getAllSqlViews() );
+        List<SqlView> views = new ArrayList<>( sqlViewService.getAllSqlViewsNoAcl() );
         Collections.sort( views, IdentifiableObjectNameComparator.INSTANCE );
         Collections.reverse( views );
 

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java	2015-01-19 10:46:09 +0000
@@ -81,6 +81,12 @@
     }
 
     @Override
+    public Collection<SqlView> getAllSqlViewsNoAcl()
+    {
+        return sqlViewStore.getAllNoAcl();
+    }
+
+    @Override
     public SqlView getSqlView( int viewId )
     {
         return sqlViewStore.get( viewId );