Bug #5879
closed
undefined local variable or method `scoped_search_definition' setting when setting permission filters
Added by Partha Aji over 10 years ago.
Updated over 6 years ago.
Category:
Users, Roles and Permissions
|
Description
1) Goto Roles
2) Select "Filters and Permissions" next to a Role
3) Select New filter
4) Select "Architecture" or "Compute Resource" under resource type
Error reported in the server..
NameError (undefined local variable or method `scoped_search_definition' for #<Class:0x0000000c7d4f18>):
app/models/concerns/authorizable.rb:31:in `allows_taxonomy_filtering?'
app/models/concerns/authorizable.rb:35:in `allows_organization_filtering?'
app/controllers/permissions_controller.rb:14:in `index'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
Rendered /home/paji/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms)
Rendered /home/paji/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.7ms)
Rendered /home/paji/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (5.9ms)
- Related to Bug #5664: Users permissions on hosts are not working properly with organizations added
- Subject changed from Unable to set permission filters to undefined local variable or method `scoped_search_definition' setting when setting permission filters
- Status changed from New to Need more information
Can you add some debug and work out what class it's failing on? Especially if you have plugins like Katello installed, since I can't replicate this on a clean Foreman installation.
It would appear from a quick code inspection that the class might not be using scoped_search, but is responding to search_for
(i.e. that it's "granular" according to Filter#granular but the class doesn't respond to scoped_search_definition).
- Status changed from Need more information to New
Oh, I think I see... #5664 starts using .scoped_search_definition, but this was only added in scoped_search 2.7.0 while we depend on >= 2.6.2.
Please try updating scoped_search to >= 2.7.0 and see if that fixes it.
Worked with scoped_search to >= 2.7.0 . Thanks!. Can ya update it in develop ?
- Status changed from New to Ready For Testing
- Assignee set to Dominic Cleal
- Target version set to 1.8.2
- Translation missing: en.field_release set to 16
- Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1107675
- Target version changed from 1.8.2 to 1.8.1
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF