Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionJustin Sherrill
2016-02-29 14:12:50 UTC
Description of problem:
Some pages and api endpoints throw an error on master
Version-Release number of selected component (if applicable):
6.2.0 (Snap1)
How reproducible:
always
Steps to Reproduce:
1. Create a role with a two filters * unlimited 'view_hosts' * 'view_statistics' under '(Miscellaneous)'
2. Create a user with that role
3. * As that user try to fetch: /api/v2/statistics
* Try to view applicable errata as that user
* Try to view installed packages as that user
Expected results:
ISE with:
| NoMethodError: undefined method `profile=' for nil:NilClass
| /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.2.2/lib/scoped_search/query_builder.rb:38:in `initialize'
| /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.2.2/lib/scoped_search/query_builder.rb:22:in `new'
| /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.2.2/lib/scoped_search/query_builder.rb:22:in `build_query'
| /usr/share/foreman/app/services/authorizer.rb:85:in `build_filtered_scope_components'
| /usr/share/foreman/app/services/authorizer.rb:49:in `find_collection'
| /usr/share/foreman/app/models/concerns/authorizable.rb:21:in `block (2 levels) in <module:Authorizable>'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/scoping/named.rb:180:in `call'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/scoping/named.rb:180:in `block (2 levels) in scope'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/scoping/default.rb:41:in `block in unscoped'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation.rb:241:in `block in scoping'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/scoping.rb:98:in `with_scope'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation.rb:241:in `scoping'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/scoping/default.rb:41:in `unscoped'
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/scoping/named.rb:180:in `block in scope'
| /usr/share/foreman/app/models/concerns/authorizable.rb:66:in `authorized'
| /usr/share/foreman/app/models/host.rb:15:in `method_missing'
Additional info:
Two small caveats, in the UI in order to do:
* fetch: /api/v2/statistics
The user also needs 'view_statistics' under '(miscellaneous)'
in order to:
* Try to view applicable errata as that user
* Try to view installed packages as that user
the user also needs: view_lifecycle_environments, view_content_views, view_organizations, view_products
How I verified:
* create role with filters mentioned in #0 and #2, add user to role
* register satellite to itself w/ sub-man, install katello-agent
statistics API is viewable (used curl with newly created user), package list for host is viewable, errata page for host is viewable. No stacks in production.log.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2016:1500