use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class MoveOrCopyTemplateCommand method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
if (permissionCheckSubject == null) {
if (imageToDestinationDomainMap == null || imageToDestinationDomainMap.isEmpty()) {
permissionCheckSubject = super.getPermissionCheckSubjects();
} else {
permissionCheckSubject = new ArrayList<>();
Set<PermissionSubject> permissionSet = new HashSet<>();
for (Guid storageId : imageToDestinationDomainMap.values()) {
permissionSet.add(new PermissionSubject(storageId, VdcObjectType.Storage, getActionType().getActionGroup()));
}
permissionCheckSubject.addAll(permissionSet);
}
}
return permissionCheckSubject;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class VmCommand 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 VmHandler method getPermissionsNeededToChangeCluster.
public static List<PermissionSubject> getPermissionsNeededToChangeCluster(Guid vmId, Guid clusterId) {
List<PermissionSubject> permissionList = new ArrayList<>();
permissionList.add(new PermissionSubject(vmId, VdcObjectType.VM, ActionGroup.EDIT_VM_PROPERTIES));
permissionList.add(new PermissionSubject(clusterId, VdcObjectType.Cluster, ActionGroup.CREATE_VM));
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class RolesCommandBase method getPermissionCheckSubjects.
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
permissionList.add(new PermissionSubject(getParameters().getRoleId(), VdcObjectType.Role, getActionType().getActionGroup()));
return permissionList;
}
use of org.ovirt.engine.core.bll.utils.PermissionSubject in project ovirt-engine by oVirt.
the class PermissionsCommandBase method getPermissionCheckSubjects.
// TODO - this code is shared with addPermissionCommand - check if
// addPermission can extend this command
@Override
public List<PermissionSubject> getPermissionCheckSubjects() {
List<PermissionSubject> permissionList = new ArrayList<>();
Permission permission = getParameters().getPermission();
permissionList.add(new PermissionSubject(permission.getObjectId(), permission.getObjectType(), getActionType().getActionGroup()));
return permissionList;
}
Aggregations