use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class StorageDomainCommandBase method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionCheckSubjects = new ArrayList<>();
permissionCheckSubjects.add(new PermissionSubject(getParameters().getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup()));
return permissionCheckSubjects;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AddVmTemplateCommandTest method testPermissionsForAddingTemplateDedicatedHostNotChanged.
@Test
public void testPermissionsForAddingTemplateDedicatedHostNotChanged() {
setupDedicatedHostForVmAndTemplate(true);
List<PermissionSubject> permissionCheckSubjects = cmd.getPermissionCheckSubjects();
for (PermissionSubject permissionSubject : permissionCheckSubjects) {
assertFalse(ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES.equals(permissionSubject.getActionGroup()));
}
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AddVmTemplateCommandTest method testPermissionsForAddingTemplateDedicatedHostChanged.
@Test
public void testPermissionsForAddingTemplateDedicatedHostChanged() {
setupDedicatedHostForVmAndTemplate(false);
PermissionSubject editDefaultHostPermission = new PermissionSubject(vm.getStoragePoolId(), VdcObjectType.StoragePool, ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES);
List<PermissionSubject> permissionCheckSubjects = cmd.getPermissionCheckSubjects();
permissionCheckSubjects.stream().filter(permissionSubject -> ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES == permissionSubject.getActionGroup()).forEach(permissionSubject -> verifyPermissions(editDefaultHostPermission, permissionSubject));
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ChangeVDSClusterCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
VdsDynamic vdsDynamic = getVds().getDynamicData();
// in order to approve a host
if (vdsDynamic != null && !VDSStatus.PendingApproval.equals(vdsDynamic.getStatus())) {
permissionList.add(new PermissionSubject(getParameters().getVdsId(), VdcObjectType.VDS, getActionType().getActionGroup()));
}
permissionList.add(new PermissionSubject(getParameters().getClusterId(), VdcObjectType.Cluster, getActionType().getActionGroup()));
List<PermissionSubject> unmodifiableList = Collections.unmodifiableList(permissionList);
return unmodifiableList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class EndExternalJobCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
permissionList.add(new PermissionSubject(MultiLevelAdministrationHandler.SYSTEM_OBJECT_ID, VdcObjectType.System, ActionGroup.INJECT_EXTERNAL_TASKS));
return permissionList;
}
Aggregations