use of org.ovirt.engine.core.aaa.DirectoryUser in project ovirt-engine by oVirt.
the class BackendUsersResource method getUserById.
private DirectoryUser getUserById(String directoryName, String namespace, String userId) {
DirectoryUser result;
try {
userId = DirectoryEntryIdUtils.decode(userId);
} catch (IllegalArgumentException exception) {
return null;
}
result = getEntity(DirectoryUser.class, QueryType.GetDirectoryUserById, new DirectoryIdQueryParameters(directoryName, namespace, userId), userId, true);
return result;
}
use of org.ovirt.engine.core.aaa.DirectoryUser in project ovirt-engine by oVirt.
the class AdElementListModel method addUsersToModel.
protected void addUsersToModel(QueryReturnValue returnValue, Set<String> excludeUsers) {
for (Queryable item : (List<Queryable>) returnValue.getReturnValue()) {
DirectoryUser a = (DirectoryUser) item;
if (!excludeUsers.contains(a.getId())) {
EntityModel<DbUser> tempVar2 = new EntityModel<>();
tempVar2.setEntity(new DbUser(a));
getusers().add(tempVar2);
}
}
}
use of org.ovirt.engine.core.aaa.DirectoryUser in project ovirt-engine by oVirt.
the class DirectoryUtils method mapPrincipalRecordToDirectoryUser.
public DirectoryUser mapPrincipalRecordToDirectoryUser(final String authzName, final ExtMap principalRecord) {
DirectoryUser directoryUser = null;
if (principalRecord != null) {
directoryUser = new DirectoryUser(authzName, principalRecord.get(Authz.PrincipalRecord.NAMESPACE), principalRecord.get(Authz.PrincipalRecord.ID), principalRecord.get(Authz.PrincipalRecord.NAME), principalRecord.get(Authz.PrincipalRecord.PRINCIPAL), principalRecord.get(Authz.PrincipalRecord.DISPLAY_NAME));
directoryUser.setDepartment(principalRecord.get(Authz.PrincipalRecord.DEPARTMENT));
directoryUser.setFirstName(principalRecord.get(Authz.PrincipalRecord.FIRST_NAME));
directoryUser.setLastName(principalRecord.get(Authz.PrincipalRecord.LAST_NAME));
directoryUser.setEmail(principalRecord.get(Authz.PrincipalRecord.EMAIL));
directoryUser.setTitle(principalRecord.get(Authz.PrincipalRecord.TITLE));
directoryUser.setPrincipal(principalRecord.get(Authz.PrincipalRecord.PRINCIPAL));
List<DirectoryGroup> directoryGroups = new ArrayList<>();
Collection<ExtMap> groups = principalRecord.get(Authz.PrincipalRecord.GROUPS);
if (groups != null) {
for (ExtMap group : groups) {
directoryGroups.add(mapGroupRecordToDirectoryGroup(authzName, group));
}
}
directoryUser.setGroups(directoryGroups);
}
return directoryUser;
}
Aggregations