← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14700: use userService.canIssueFilter on UserRoleController output

 

------------------------------------------------------------
revno: 14700
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-04-06 20:11:26 +0700
message:
  use userService.canIssueFilter on UserRoleController output
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/UserRoleController.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/api/controller/user/UserRoleController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/UserRoleController.java	2014-04-06 12:57:58 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/UserRoleController.java	2014-04-06 13:11:26 +0000
@@ -29,10 +29,16 @@
  */
 
 import org.hisp.dhis.api.controller.AbstractCrudController;
+import org.hisp.dhis.api.controller.WebMetaData;
+import org.hisp.dhis.api.controller.WebOptions;
 import org.hisp.dhis.user.UserAuthorityGroup;
+import org.hisp.dhis.user.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import java.util.List;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -42,4 +48,16 @@
     extends AbstractCrudController<UserAuthorityGroup>
 {
     public static final String RESOURCE_PATH = "/userRoles";
+
+    @Autowired
+    private UserService userService;
+
+    @Override
+    protected List<UserAuthorityGroup> getEntityList( WebMetaData metaData, WebOptions options )
+    {
+        List<UserAuthorityGroup> entityList = super.getEntityList( metaData, options );
+        userService.canIssueFilter( entityList );
+
+        return entityList;
+    }
 }