Bug #5879

undefined local variable or method `scoped_search_definition' setting when setting permission filters

Added by Partha Aji over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Dominic Cleal
Category:Authorization
Target version:Sprint 25
Difficulty: Bugzilla link:1107675
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.1Release relationshipAuto

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 issues

Related to Foreman - Bug #5664: Users permissions on hosts are not working properly with ... Closed 05/11/2014

Associated revisions

Revision 447e48f1
Added by Dominic Cleal over 3 years ago

fixes #5879 - minimum of scoped_search 2.7.0 required

Revision 13e1bc71
Added by Dominic Cleal over 3 years ago

refs #5879 - minimum of scoped_search 2.7.0 required

History

#1 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #5664: Users permissions on hosts are not working properly with organizations added

#2 Updated by Dominic Cleal over 3 years ago

  • 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).

#3 Updated by Dominic Cleal over 3 years ago

  • 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.

#4 Updated by Partha Aji over 3 years ago

Worked with scoped_search to >= 2.7.0 . Thanks!. Can ya update it in develop ?

#5 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Dominic Cleal
  • Target version set to Sprint 24
  • Release set to 1.5.1

#6 Updated by Bryan Kearney over 3 years ago

  • Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1107675

#7 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 24 to Sprint 25

#8 Updated by Dominic Cleal over 3 years ago

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

Also available in: Atom PDF