Bug 1433677 - Organization/Location edit fails for user with granular filters on taxable resources
Summary: Organization/Location edit fails for user with granular filters on taxable re...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Organizations and Locations
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Tomer Brisker
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-19 08:58 UTC by Tomer Brisker
Modified: 2020-04-15 15:31 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:51:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15278 0 Normal Closed Organization/Location edit fails for user with granular filters on taxable resources 2020-10-08 20:03:34 UTC

Description Tomer Brisker 2017-03-19 08:58:24 UTC
To reproduce, log in as a user that can edit organizations and has filter with view_domains permission limited by some condition, e.g. "name = example.tst". Then try to edit organization, you'll get following error.

<pre>
2016-06-03T10:12:33 [app] [I] Completed 500 Internal Server Error in 598ms (ActiveRecord: 26.7ms)
2016-06-03T10:12:33 [app] [F] 
 | ActionView::Template::Error (undefined method `+' for nil:NilClass):
 |     72:         <%= show_resource_if_allowed(f, taxonomy, :media) %>
 |     73:         <%= show_resource_if_allowed(f, taxonomy, :provisioning_templates) %>
 |     74:         <%= show_resource_if_allowed(f, taxonomy, :ptables) %>
 |     75:         <%= show_resource_if_allowed(f, taxonomy, :domains) %>
 |     76:         <%= show_resource_if_allowed(f, taxonomy, :realms) %>
 |     77:       <% end %>
 |     78: 
 |   app/helpers/taxonomy_helper.rb:168:in `block in show_resource_if_allowed'
 |   app/helpers/taxonomy_helper.rb:161:in `show_resource_if_allowed'
 |   app/views/taxonomies/_form.html.erb:75:in `block in _41d581d22153a1f3bc601f3bab07e05e'
 |   app/helpers/form_helper.rb:258:in `form_for'
 |   app/views/taxonomies/_form.html.erb:3:in `_41d581d22153a1f3bc601f3bab07e05e'
 |   app/views/taxonomies/edit.html.erb:4:in `_b131f05b99c73b981f94f66e0d5cc429'
 |   app/controllers/concerns/foreman/controller/taxonomies_controller.rb:67:in `block in edit'
 |   app/models/taxonomy.rb:76:in `block in no_taxonomy_scope'
 |   app/models/taxonomy.rb:83:in `block (2 levels) in as_taxonomy'
 |   app/models/concerns/foreman/thread_session.rb:147:in `as_location'
 |   app/models/taxonomy.rb:82:in `block in as_taxonomy'
 |   app/models/concerns/foreman/thread_session.rb:112:in `as_org'
 |   app/models/taxonomy.rb:81:in `as_taxonomy'
 |   app/models/taxonomy.rb:75:in `no_taxonomy_scope'
 |   app/controllers/concerns/foreman/controller/taxonomies_controller.rb:65:in `edit'
 |   app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 |   app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 |   lib/middleware/catch_json_parse_errors.rb:9:in `call'
</pre>

Comment 1 Tomer Brisker 2017-03-19 08:58:28 UTC
Created from redmine issue http://projects.theforeman.org/issues/15278

Comment 2 Tomer Brisker 2017-03-19 08:58:33 UTC
Upstream bug assigned to mhulan

Comment 6 Tomer Brisker 2017-08-23 16:05:05 UTC
Verified on Satellite 6.3.0 snap 12.

Created user with following permissions:

assign_organizations, destroy_organizations, edit_organizations, create_organizations, view_organizations - unlimited
view_domains - search: "name = tbrisker.example.com"

Logged in as user with these permissions, go to edit organization page - domain is shown when in the organization, no crash.

Comment 7 Bryan Kearney 2018-02-21 16:43:47 UTC
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/RHSA-2018:0336

Comment 8 Satellite Program 2018-02-21 16:51:07 UTC
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/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.