------------------------------------------------------------
revno: 18112
committer: Morten Olav Hansen <morte...@gmail.com>
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 ) );
             }
         }
 

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to