Search in sources :

Example 16 with Role

use of org.ovirt.engine.api.model.Role in project ovirt-engine by oVirt.

the class BackendEntityAssignedPermissionsResourceTest method getModel.

@Override
protected Permission getModel() {
    Permission model = new Permission();
    model.setUser(new User());
    model.getUser().setId(GUIDS[1].toString());
    model.setRole(new Role());
    model.getRole().setId(GUIDS[3].toString());
    return model;
}
Also used : Role(org.ovirt.engine.api.model.Role) User(org.ovirt.engine.api.model.User) Permission(org.ovirt.engine.api.model.Permission)

Example 17 with Role

use of org.ovirt.engine.api.model.Role in project ovirt-engine by oVirt.

the class BackendGroupAssignedPermissionsResourceTest method getModel.

@Override
protected Permission getModel() {
    Permission model = new Permission();
    model.setDataCenter(new DataCenter());
    model.getDataCenter().setId(GUIDS[2].toString());
    model.setRole(new Role());
    model.getRole().setId(GUIDS[3].toString());
    return model;
}
Also used : Role(org.ovirt.engine.api.model.Role) DataCenter(org.ovirt.engine.api.model.DataCenter) Permission(org.ovirt.engine.api.model.Permission)

Example 18 with Role

use of org.ovirt.engine.api.model.Role 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");
    }
}
Also used : Role(org.ovirt.engine.api.model.Role) Group(org.ovirt.engine.api.model.Group) WebApplicationException(javax.ws.rs.WebApplicationException) Permission(org.ovirt.engine.api.model.Permission) Test(org.junit.Test)

Example 19 with Role

use of org.ovirt.engine.api.model.Role in project ovirt-engine by oVirt.

the class BackendUserAssignedPermissionsResourceTest method getModel.

@Override
protected Permission getModel() {
    Permission model = new Permission();
    model.setDataCenter(new DataCenter());
    model.getDataCenter().setId(GUIDS[2].toString());
    model.setRole(new Role());
    model.getRole().setId(GUIDS[3].toString());
    return model;
}
Also used : Role(org.ovirt.engine.api.model.Role) DataCenter(org.ovirt.engine.api.model.DataCenter) Permission(org.ovirt.engine.api.model.Permission)

Example 20 with Role

use of org.ovirt.engine.api.model.Role in project ovirt-engine by oVirt.

the class BackendRoleResourceTest method getModel.

private Role getModel() {
    Role role = new Role();
    role.setName(NAMES[0]);
    return role;
}
Also used : Role(org.ovirt.engine.api.model.Role)

Aggregations

Role (org.ovirt.engine.api.model.Role)22 Test (org.junit.Test)12 WebApplicationException (javax.ws.rs.WebApplicationException)8 Permission (org.ovirt.engine.api.model.Permission)8 User (org.ovirt.engine.api.model.User)7 Permits (org.ovirt.engine.api.model.Permits)4 Roles (org.ovirt.engine.api.model.Roles)4 Response (javax.ws.rs.core.Response)3 DataCenter (org.ovirt.engine.api.model.DataCenter)3 Permit (org.ovirt.engine.api.model.Permit)3 Group (org.ovirt.engine.api.model.Group)2 V3Role (org.ovirt.engine.api.v3.types.V3Role)1