dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #34704
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17796: Supportive method for getting managed users
------------------------------------------------------------
revno: 17796
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-12-25 15:21:10 +0100
message:
Supportive method for getting managed users
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.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/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2014-12-25 14:10:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2014-12-25 14:21:10 +0000
@@ -248,7 +248,19 @@
{
return userCredentials != null && userCredentials.isSuper();
}
-
+
+ public Set<UserGroup> getManagedGroups()
+ {
+ Set<UserGroup> managedGroups = new HashSet<>();
+
+ for ( UserGroup group : groups )
+ {
+ managedGroups.addAll( group.getManagedGroups() );
+ }
+
+ return managedGroups;
+ }
+
/**
* Indicates whether this user can manage the given user group.
*