use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class SetVmNumaNodesCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, getActionType().getActionGroup()));
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class UpdateVmNumaNodesCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, getActionType().getActionGroup()));
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AddClusterCommandTest method getPermissionCheckSubjectsTest.
@Test
public void getPermissionCheckSubjectsTest() {
List<PermissionSubject> permissions = addClusterCommand.getPermissionCheckSubjects();
assertEquals(2, permissions.size());
PermissionSubject permissionSubject = permissions.get(0);
assertEquals(cluster.getStoragePoolId(), permissionSubject.getObjectId());
assertEquals(VdcObjectType.StoragePool, permissionSubject.getObjectType());
/**
* @TODO : Once there is a way to get the ActionType properly from the permissionSubject add the following test:
* assertEquals(ActionGroup.CREATE_CLUSTER, permissionSubject.getActionGroup());
*
* This test doesn't work because it relies on the class's name which mockito changes.
*/
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ExtendImageSizeCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
if (permissionsList == null) {
permissionsList = new ArrayList<>();
permissionsList.add(new PermissionSubject(getImage().getId(), VdcObjectType.Disk, ActionGroup.EDIT_DISK_PROPERTIES));
}
return permissionsList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ForceSelectSPMCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissions = new ArrayList<>();
permissions.add(new PermissionSubject(getParameters().getPreferredSPMId(), VdcObjectType.VDS, ActionGroup.MANIPULATE_HOST));
return permissions;
}
Aggregations