← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18112: minor fix, only call getCurrentUser one time for getAccess in CurrentUserController

 

------------------------------------------------------------
revno: 18112
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-01-23 21:23:04 +0700
message:
  minor fix, only call getCurrentUser one time for getAccess in CurrentUserController
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java	2015-01-19 08:13:30 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java	2015-01-23 14:23:04 +0000
@@ -190,9 +190,9 @@
     @RequestMapping( value = "/dashboards", produces = { "application/json", "text/*" } )
     public void getDashboards( HttpServletResponse response ) throws NotAuthenticatedException, IOException
     {
-        User currentUser = currentUserService.getCurrentUser();
+        User user = currentUserService.getCurrentUser();
 
-        if ( currentUser == null )
+        if ( user == null )
         {
             throw new NotAuthenticatedException();
         }
@@ -201,11 +201,11 @@
 
         for ( org.hisp.dhis.dashboard.Dashboard dashboard : dashboards )
         {
-            dashboard.setAccess( aclService.getAccess( dashboard ) );
+            dashboard.setAccess( aclService.getAccess( dashboard, user ) );
 
             for ( DashboardItem dashboardItem : dashboard.getItems() )
             {
-                dashboardItem.setAccess( aclService.getAccess( dashboardItem ) );
+                dashboardItem.setAccess( aclService.getAccess( dashboardItem, user ) );
             }
         }