Project

General

Profile

Bug #5489

Permission migration script can create invalid search conditions

Added by Marek Hulán almost 5 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Authorization
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

after migration a user reported filters with search phrases like "(() or (compute_resource_id = 2))" which raises scoped search exceptions, we should go over the whole migration script and make sure we can't detect empty conditions


Related issues

Blocks Foreman - Tracker #4552: New permissions/authorization system issuesNew

Associated revisions

Revision fec952bd (diff)
Added by Dominic Cleal almost 5 years ago

fixes #5489 - don't generate empty search () filters on permissions migration

Revision f56b5931 (diff)
Added by Dominic Cleal almost 5 years ago

fixes #5489 - don't generate empty search () filters on permissions migration

(cherry picked from commit fec952bd2002f672a8907821169c0675d04cfbbc)

History

#1 Updated by Marek Hulán almost 5 years ago

  • Blocks Tracker #4552: New permissions/authorization system issues added

#2 Updated by Marek Hulán almost 5 years ago

one clue (but worth of checking all condition generating)

the only users who had the incorrect search string syntax were ones that had ownership of more than one hostgroup

#3 Updated by Dominic Cleal almost 5 years ago

  • Target version set to 1.8.3
  • Legacy Backlogs Release (now unused) set to 4

#4 Updated by Dominic Cleal almost 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#5 Updated by Dominic Cleal almost 5 years ago

To reproduce:

0. Use pre-#812 Foreman
1. Create a user with the "View hosts" role (#5540)
2. Edit the user, add two types of filter: a domain filter + a host group filter. Do not tick owned hosts.
3. Migrate to post-#812
4. Check the custom role + filter added, you'll see: (() or (domain_id = 1)) or (hostgroup_id = 1)

#6 Updated by Dominic Cleal almost 5 years ago

  • Status changed from Assigned to Ready For Testing

#7 Updated by Dominic Cleal almost 5 years ago

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

Also available in: Atom PDF