New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the current userid when running a report #30

Merged
merged 1 commit into from Aug 22, 2017

Conversation

Projects
None yet
5 participants
@imtayadeway
Contributor

imtayadeway commented Aug 21, 2017

With nothing specified it defaults to "system". Since we now enforce
checking the ownership of report results, the report results' userid
must be set to the current user instead.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1479296

@miq-bot add-label bug
@miq-bot assign @abellotti
/cc @gtanzillo @yrudman

UPDATE:

Just verified this.

Before:

GET http://localhost:3000/api/results/1r1

{
    "error": {
        "kind": "not_found",
        "message": "Couldn't find MiqReportResult with 'id'=1000000000001 [WHERE \"miq_report_results\".\"miq_group_id\" = 1000000000004]",
        "klass": "ActiveRecord::RecordNotFound"
    }
}

After

GET http://localhost:3000/api/results/1r2

{
    "href": "http://localhost:3000/api/results/1r2",
    "id": "1r2",
    "name": "VMs with Volume Free Space > 50% by Department",
    "miq_report_id": "1r1",
    "miq_task_id": "1r2",
    "userid": "tim",
    "report_source": "Requested by user",
    "db": "Vm",
    "created_on": "2017-08-21T23:53:22Z",
    "miq_group_id": "1r4",
    "result_set": []
}
Set the current userid when running a report
With nothing specified it defaults to "system". Since we now enforce
checking the ownership of report results, the report results' userid
must be set to the current user instead.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1479296
@miq-bot

This comment has been minimized.

Show comment
Hide comment
@miq-bot

miq-bot Aug 21, 2017

Member

Checked commit imtayadeway@5f73e46 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

Member

miq-bot commented Aug 21, 2017

Checked commit imtayadeway@5f73e46 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@gtanzillo

This comment has been minimized.

Show comment
Hide comment
@gtanzillo

gtanzillo Aug 21, 2017

Member

@imtayadeway I like this change 👍 much better that doing the revert. Just to be sure, were you able to recreated the reported issue and verify that this change addresses it?

Member

gtanzillo commented Aug 21, 2017

@imtayadeway I like this change 👍 much better that doing the revert. Just to be sure, were you able to recreated the reported issue and verify that this change addresses it?

@abellotti

This comment has been minimized.

Show comment
Hide comment
@abellotti

abellotti Aug 21, 2017

Member

👍 on this change.

Member

abellotti commented Aug 21, 2017

👍 on this change.

@gtanzillo gtanzillo merged commit 2a38bb9 into ManageIQ:master Aug 22, 2017

3 checks passed

Hakiri No security warnings were found.
Details
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gtanzillo gtanzillo added the fine/yes label Aug 22, 2017

@simaishi

This comment has been minimized.

Show comment
Hide comment
@simaishi

simaishi Aug 23, 2017

Contributor

Backported to Fine via ManageIQ/manageiq#15868

Contributor

simaishi commented Aug 23, 2017

Backported to Fine via ManageIQ/manageiq#15868

@simaishi simaishi added fine/backported and removed fine/yes labels Aug 23, 2017

@imtayadeway imtayadeway deleted the imtayadeway:bug/set-user-when-creating-report branch Jan 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment