use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class UpdateVmTemplateInterfaceCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = super.getPermissionCheckSubjects();
VmNic nic = getParameters().getInterface();
if (nic != null && nic.getVnicProfileId() != null && getVmTemplate() != null) {
VmNic oldNic = vmNicDao.get(nic.getId());
if (oldNic == null || isVnicProfileChanged(oldNic, nic)) {
permissionList.add(new PermissionSubject(nic.getVnicProfileId(), VdcObjectType.VnicProfile, getActionType().getActionGroup()));
}
}
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AddVmNumaNodesCommand 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 TransferDiskImageCommandTest method testPermissionSubjectOnProvidedImage.
@Test
public void testPermissionSubjectOnProvidedImage() {
initializeSuppliedImage();
assertEquals(getCommand().getPermissionCheckSubjects().get(0), new PermissionSubject(getCommand().getParameters().getImageGroupID(), VdcObjectType.Disk, ActionGroup.EDIT_DISK_PROPERTIES));
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AddQuotaCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionsSubject = new ArrayList<>();
permissionsSubject.add(new PermissionSubject(getStoragePoolId(), VdcObjectType.StoragePool, getActionType().getActionGroup()));
if (getParameters().isCopyPermissions()) {
permissionsSubject.add(new PermissionSubject(getStoragePoolId(), VdcObjectType.StoragePool, ActionGroup.MANIPULATE_PERMISSIONS));
}
return permissionsSubject;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class CloneVmCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
permissionList.add(new PermissionSubject(getParameters().getVmId(), VdcObjectType.VM, getActionType().getActionGroup()));
return permissionList;
}
Aggregations