← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14635: Added DataApprovalLevelService.getUserDataApprovalLevels()

 

------------------------------------------------------------
revno: 14635
committer: Jim Grace <jimgrace@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-04-03 09:49:39 -0400
message:
  Added DataApprovalLevelService.getUserDataApprovalLevels()
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.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/dataapproval/DataApprovalLevelService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java	2014-04-03 12:01:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java	2014-04-03 13:49:39 +0000
@@ -45,6 +45,14 @@
     List<DataApprovalLevel> getAllDataApprovalLevels();
 
     /**
+     * Gets a list of the data approval levels for which the user has
+     * permission to approve, un.
+     *
+     * @return List of all data approval levels, ordered from 1 to n.
+     */
+    List<DataApprovalLevel> getUserDataApprovalLevels();
+
+    /**
      * Gets data approval levels by org unit level.
      * 
      * @param orgUnitLevel the org unit level.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java	2014-04-03 12:01:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java	2014-04-03 13:49:39 +0000
@@ -99,6 +99,12 @@
 
         return dataApprovalLevels;
     }
+
+    public List<DataApprovalLevel> getUserDataApprovalLevels()
+    {
+        //TODO: Write the logic to filter the list according to the user.
+        return getAllDataApprovalLevels();
+    }
     
     public List<DataApprovalLevel> getDataApprovalLevelsByOrgUnitLevel( int orgUnitLevel )
     {