use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class NetworkCommon method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
Network network = getNetwork();
Guid networkId = network == null ? null : network.getId();
return Collections.singletonList(new PermissionSubject(networkId, VdcObjectType.Network, getActionType().getActionGroup()));
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AttachNetworkClusterPermissionsChecker method checkPermissions.
public boolean checkPermissions(CommandBase<?> command, List<PermissionSubject> permissionCheckSubjects) {
final List<String> messages = new ArrayList<>();
for (PermissionSubject permSubject : permissionCheckSubjects) {
messages.clear();
if (command.checkSinglePermission(permSubject, messages)) {
return true;
}
}
command.getReturnValue().getValidationMessages().addAll(messages);
return false;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ImportVmCommandBase method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
// Destination cluster
permissionList.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CREATE_VM));
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ImportVmFromExternalProviderCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = super.getPermissionCheckSubjects();
// Destination domain
permissionList.add(new PermissionSubject(getStorageDomainId(), VdcObjectType.Storage, getActionType().getActionGroup()));
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ExportOvaCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionSubjects = new ArrayList<>();
permissionSubjects.add(new PermissionSubject(getParameters().getEntityId(), getParameters().getEntityType() == VmEntityType.VM ? VdcObjectType.VM : VdcObjectType.VmTemplate, getActionType().getActionGroup()));
return permissionSubjects;
}
Aggregations