use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ImportRepoImageCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionSubjects = new ArrayList<>();
// NOTE: there's no read-permission from a storage domain
permissionSubjects.add(new PermissionSubject(getParameters().getStorageDomainId(), VdcObjectType.Storage, ActionGroup.CREATE_DISK));
permissionSubjects.add(new PermissionSubject(getParameters().getSourceStorageDomainId(), VdcObjectType.Storage, ActionGroup.ACCESS_IMAGE_STORAGE));
return permissionSubjects;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class ExportRepoImageCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionSubjects = new ArrayList<>();
DiskImage diskImage = getDiskImage();
if (diskImage != null) {
permissionSubjects.add(new PermissionSubject(diskImage.getId(), VdcObjectType.Disk, ActionGroup.ATTACH_DISK));
}
permissionSubjects.add(new PermissionSubject(getParameters().getDestinationDomainId(), VdcObjectType.Storage, ActionGroup.CREATE_DISK));
return permissionSubjects;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class UpdateNetworkClusterPermissionsChecker method findPermissionCheckSubjects.
public List<PermissionSubject> findPermissionCheckSubjects(Guid networkId, Guid clusterId, ActionType actionType) {
List<PermissionSubject> permissions = clusterPermissionsFinder.findPermissionCheckSubjects(clusterId, actionType);
permissions.add(new PermissionSubject(networkId, VdcObjectType.Network, ActionGroup.ASSIGN_CLUSTER_NETWORK));
return permissions;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class AttachNetworkClusterPermissionsChecker method findPermissionCheckSubjects.
public List<PermissionSubject> findPermissionCheckSubjects(NetworkCluster networkCluster, ActionType actionType) {
final List<PermissionSubject> permissions = new ArrayList<>();
final Guid networkId = networkCluster == null ? null : networkCluster.getNetworkId();
// require permissions on network
permissions.add(new PermissionSubject(networkId, VdcObjectType.Network, actionType.getActionGroup()));
return permissions;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class UpdateVmDiskCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
if (listPermissionSubjects == null) {
listPermissionSubjects = new ArrayList<>();
Guid diskId = (getOldDisk() == null) ? null : getOldDisk().getId();
listPermissionSubjects.add(new PermissionSubject(diskId, VdcObjectType.Disk, ActionGroup.EDIT_DISK_PROPERTIES));
if (getOldDisk() != null && getNewDisk() != null && getOldDisk().getSgio() != getNewDisk().getSgio()) {
listPermissionSubjects.add(new PermissionSubject(diskId, VdcObjectType.Disk, ActionGroup.CONFIGURE_SCSI_GENERIC_IO));
}
}
return listPermissionSubjects;
}
Aggregations