use of org.alfresco.rest.api.model.Group in project alfresco-remote-api by Alfresco.
the class GroupsImpl method getGroup.
private Group getGroup(AuthorityInfo authorityInfo, List<String> includeParam, Set<String> rootAuthorities) {
if (authorityInfo == null) {
return null;
}
Group group = new Group();
group.setId(authorityInfo.getAuthorityName());
// REPO-1743
String authorityDisplayName = authorityInfo.getAuthorityDisplayName();
if (authorityDisplayName == null || authorityDisplayName.isEmpty()) {
authorityDisplayName = authorityService.getAuthorityDisplayName(authorityInfo.getAuthorityName());
}
group.setDisplayName(authorityDisplayName);
group.setIsRoot(isRootAuthority(rootAuthorities, authorityInfo.getAuthorityName()));
// Optionally include
if (includeParam != null) {
if (includeParam.contains(PARAM_INCLUDE_PARENT_IDS)) {
String authority = authorityInfo.getAuthorityName();
Set<String> containingAuthorities = Collections.emptySet();
// is a special case, AuthorityType.EVERYONE is not, and an exception is thrown.
if (!authority.equalsIgnoreCase(PermissionService.ALL_AUTHORITIES)) {
containingAuthorities = authorityService.getContainingAuthorities(AuthorityType.GROUP, authority, true);
}
group.setParentIds(containingAuthorities);
}
if (includeParam.contains(PARAM_INCLUDE_ZONES)) {
Set<String> authorityZones = authorityService.getAuthorityZones(authorityInfo.getAuthorityName());
group.setZones(authorityZones);
}
}
return group;
}
Aggregations