Project

General

Profile

Bug #15278

Organization/Location edit fails for user with granular filters on taxable resources

Added by Marek Hulán over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

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.

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'

Related issues

Related to Foreman - Tracker #10022: Taxonomies related issuesNew2015-04-05

Associated revisions

Revision f358e676 (diff)
Added by Marek Hulán over 4 years ago

Fixes #15278 - taxonomies support granular filters

Revision 58f6c4df (diff)
Added by Marek Hulán over 4 years ago

Fixes #15278 - taxonomies support granular filters

(cherry picked from commit f358e67675391aaf8151f6c55227d3a6919738a9)

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3571 added

#2 Updated by Marek Hulán over 4 years ago

#3 Updated by Marek Hulán over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 161

#5 Updated by Tomer Brisker over 3 years ago

  • Bugzilla link set to 1433677

Also available in: Atom PDF