dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35285
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18111: minor fix, only call getCurrentUser one time for addAccessProperties
------------------------------------------------------------
revno: 18111
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-01-23 21:17:20 +0700
message:
minor fix, only call getCurrentUser one time for addAccessProperties
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.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/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java 2015-01-23 14:17:20 +0000
@@ -58,6 +58,7 @@
import org.hisp.dhis.schema.Schema;
import org.hisp.dhis.schema.SchemaService;
import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.User;
import org.hisp.dhis.webapi.controller.exception.NotFoundException;
import org.hisp.dhis.webapi.service.ContextService;
import org.hisp.dhis.webapi.service.LinkService;
@@ -830,9 +831,11 @@
protected void addAccessProperties( List<T> objects )
{
+ User user = currentUserService.getCurrentUser();
+
for ( T object : objects )
{
- ((BaseIdentifiableObject) object).setAccess( aclService.getAccess( object ) );
+ ((BaseIdentifiableObject) object).setAccess( aclService.getAccess( object, user ) );
}
}