Skip to content
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

Find correct klass for rbac check for retirevms #1136

Merged
merged 2 commits into from Apr 25, 2017
Merged

Find correct klass for rbac check for retirevms #1136

merged 2 commits into from Apr 25, 2017

Conversation

isimluk
Copy link
Member

@isimluk isimluk commented Apr 24, 2017

One would think that retirevms method would operate on Vm records.
That's not the case. Caveat programmer!

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

Introduced in 457b085.

Addressing:

Error caught: [NoMethodError] undefined method `all' for nil:NilClass
lib/rbac/filterer.rb:545:in `apply_scope'
lib/rbac/filterer.rb:205:in `search'
lib/rbac/filterer.rb:112:in `search'
lib/rbac.rb:3:in `search'
manageiq-ui-classic-d32ec1b1bfc2/app/controllers/application_controller.rb:2265:in `assert_rbac'
manageiq-ui-classic-d32ec1b1bfc2/app/controllers/mixins/checked_id_mixin.rb:35:in `find_checked_ids_with_rbac'
manageiq-ui-classic-d32ec1b1bfc2/app/controllers/application_controller/ci_processing.rb:219:in `retirevms'

@miq-bot add_label bug, fine/yes

Just kidding, this will ensure we populate rec_cls variable first
before the klass variable. That way we can re-use the rec_cls when
populating klass variable.
One would think that retirevms method would operate on Vm records.
That's not the case. Caveat programmer!

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

Introduced in 457b085.

Addressing:
Error caught: [NoMethodError] undefined method `all' for nil:NilClass
lib/rbac/filterer.rb:545:in `apply_scope'
lib/rbac/filterer.rb:205:in `search'
lib/rbac/filterer.rb:112:in `search'
lib/rbac.rb:3:in `search'
manageiq-ui-classic-d32ec1b1bfc2/app/controllers/application_controller.rb:2265:in `assert_rbac'
manageiq-ui-classic-d32ec1b1bfc2/app/controllers/mixins/checked_id_mixin.rb:35:in `find_checked_ids_with_rbac'
manageiq-ui-classic-d32ec1b1bfc2/app/controllers/application_controller/ci_processing.rb:219:in `retirevms'
@isimluk
Copy link
Member Author

isimluk commented Apr 24, 2017

@miq-bot assign @martinpovolny
/cc @PanSpagetka

@miq-bot
Copy link
Member

miq-bot commented Apr 24, 2017

Checked commits https://github.com/isimluk/manageiq-ui-classic/compare/0732b5e90c2b78859b66ad124aac8ba821f81196~...414a9fb9e3c136eba9f615d2029318675bbb2f0f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. 🍰

@dclarizio dclarizio added the rbac label Apr 24, 2017
@martinpovolny martinpovolny merged commit d7743ae into ManageIQ:master Apr 25, 2017
@martinpovolny martinpovolny modified the milestones: Sprint 59 Ending Apr 24, 2017, Sprint 60 Ending May 8, 2017 Apr 25, 2017
@isimluk isimluk deleted the rhbz#1442691 branch April 25, 2017 10:20
simaishi pushed a commit that referenced this pull request Apr 25, 2017
Find correct klass for rbac check for `retirevms`
(cherry picked from commit d7743ae)

https://bugzilla.redhat.com/show_bug.cgi?id=1445283
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit cbc9d43c1215caa17cffa61998210b35c6e1fbb6
Author: Martin Povolny <mpovolny@redhat.com>
Date:   Tue Apr 25 09:54:20 2017 +0200

    Merge pull request #1136 from isimluk/rhbz#1442691
    
    Find correct klass for rbac check for `retirevms`
    (cherry picked from commit d7743ae1d14622f6c5e0ca0139029496de20f5ca)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1445283

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

Successfully merging this pull request may close these issues.

None yet

5 participants