user group membership
This commit is contained in:
1 parent
33ac048c8c
commit
21119604c6
9 files changed
+262
-2
No files matched your search
@@ -60,10 +60,25 @@ import java.util.Set;
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class ModelToRepresentation {
|
||||
public static void buildGroupPath(StringBuilder sb, GroupModel group) {
|
||||
if (group.getParent() != null) {
|
||||
buildGroupPath(sb, group.getParent());
|
||||
}
|
||||
sb.append('/').append(group.getName());
|
||||
}
|
||||
|
||||
public static String buildGroupPath(GroupModel group) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
buildGroupPath(sb, group);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public static GroupRepresentation toRepresentation(GroupModel group, boolean full) {
|
||||
GroupRepresentation rep = new GroupRepresentation();
|
||||
rep.setId(group.getId());
|
||||
rep.setName(group.getName());
|
||||
rep.setPath(buildGroupPath(group));
|
||||
if (!full) return rep;
|
||||
// Role mappings
|
||||
Set<RoleModel> roles = group.getRoleMappings();
|
||||
|
||||
Reference in new issue
Block a user