Project

General

Profile

Bug #30555

Authorizer is unable to handle association mismatch

Added by Ondřej Ezr 3 months ago. Updated 10 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Users, Roles and Permissions
Target version:
Difficulty:
medium
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Authorizer is not able to handle situations of filter being defined for association that is defined on Host::Managed, if association to the Host is to the Host::Base

Example:

Filter( permissions: ['view_hosts'], search: 'os = Debian' )
Authorizer#find_collection(Host, permission: :view_hosts, joined_on: FactValue)

Related issues

Related to Foreman - Bug #30681: Filter on fact value is not working properly when FactValue has some default loadsClosed
Has duplicate Foreman - Bug #29011: Adding search for Operating system in role's host filter with permission view_hosts does not construct SQL query when API is usedDuplicate

Associated revisions

Revision f4d9295e (diff)
Added by Ondřej Ezr 2 months ago

Fixes #30555 - Authorizer uses subselect for joined_on (#7877)

if we use joined_on class, we are using the where clause on that class through the association.
This is very volatile and it doesnt play well with the Host STI.

See the test for example failure

History

#1 Updated by Ondřej Ezr 3 months ago

  • Related to Bug #29011: Adding search for Operating system in role's host filter with permission view_hosts does not construct SQL query when API is used added

#2 Updated by The Foreman Bot 3 months ago

  • Assignee set to Ondřej Ezr
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7877 added

#3 Updated by Ondřej Ezr 2 months ago

  • Related to Bug #30681: Filter on fact value is not working properly when FactValue has some default loads added

#4 Updated by The Foreman Bot 2 months ago

  • Fixed in Releases 2.3.0 added

#5 Updated by Ondřej Ezr 2 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Ondřej Ezr 2 months ago

  • Related to deleted (Bug #29011: Adding search for Operating system in role's host filter with permission view_hosts does not construct SQL query when API is used)

#7 Updated by Ondřej Ezr 2 months ago

  • Has duplicate Bug #29011: Adding search for Operating system in role's host filter with permission view_hosts does not construct SQL query when API is used added

#8 Updated by The Foreman Bot about 2 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7975 added

#9 Updated by Tomer Brisker 10 days ago

  • Target version changed from 2.2.0 to 2.3.0

Also available in: Atom PDF