use of org.ovirt.engine.api.model.Group in project ovirt-engine by oVirt.
the class BackendGroupAssignedPermissionsResourceTest method testAddIncompletePermission.
@Test
public void testAddIncompletePermission() throws Exception {
Permission model = new Permission();
model.setGroup(new Group());
model.getGroup().setId(GUIDS[1].toString());
model.setRole(new Role());
model.getRole().setId(GUIDS[3].toString());
setUriInfo(setUpBasicUriExpectations());
try {
collection.add(model);
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "Permission", "add", "dataCenter|cluster|host|storageDomain|vm|vmPool|template.id");
}
}
use of org.ovirt.engine.api.model.Group in project ovirt-engine by oVirt.
the class GroupMapper method map.
@Mapping(from = DirectoryGroup.class, to = Group.class)
public static Group map(DirectoryGroup entity, Group template) {
Group model = template != null ? template : new Group();
model.setName(entity.getName());
if (!StringUtils.isEmpty(entity.getDirectoryName())) {
Domain dom = new Domain();
dom.setName(entity.getDirectoryName());
dom.setId(DirectoryEntryIdUtils.encode(dom.getName()));
model.setDomain(dom);
}
model.setId(DirectoryEntryIdUtils.encode(entity.getId()));
model.setNamespace(entity.getNamespace());
return model;
}
use of org.ovirt.engine.api.model.Group in project ovirt-engine by oVirt.
the class GroupMapper method map.
@Mapping(from = AuthzGroup.class, to = Group.class)
public static Group map(AuthzGroup authzGroup, Group template) {
Group model = template != null ? template : new Group();
model.setId(DirectoryEntryIdUtils.encode(authzGroup.getId()));
model.setName(authzGroup.getName());
model.setNamespace(authzGroup.getNamespace());
if (!StringUtils.isEmpty(authzGroup.getAuthz())) {
Domain dom = new Domain();
dom.setName(authzGroup.getAuthz());
dom.setId(DirectoryEntryIdUtils.encode(dom.getName()));
model.setDomain(dom);
}
return model;
}
use of org.ovirt.engine.api.model.Group in project ovirt-engine by oVirt.
the class BackendGroupTagResource method addParents.
@Override
protected Tag addParents(Tag tag) {
Group group = new Group();
group.setId(groupId.toString());
tag.setGroup(group);
return tag;
}
Aggregations