Project

General

Profile

Bug #8812

Pass model type in API base controller

Added by Daniel Lobato Garcia almost 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

At least on version 1.6.1, the absence of this second parameter leads to a
runtime crash when it's time to validate if the current user (non-admin) is
allowed to perform a power operation on given a host via the APIv2.

The root cause of the crash is basically that search_for is called on
Host::Base by app/services/authorizer.rb:50.

Not sure this is necessary in newer versions, up to the developers to figure
it out :)


Related issues

Has duplicate Foreman - Bug #6403: power API returns error if using a hostgroup_id search filterDuplicate2014-06-26
Has duplicate Foreman - Bug #9314: power-state change on vms in aws-compute resource cause 500 server errorDuplicate2015-02-10

Associated revisions

Revision e02a2ff2 (diff)
Added by Julien Pivotto over 5 years ago

Fixes #8812 - Pass model type so search_for is called on Host

At least on version 1.6.1, the absence of this second parameter leads to a
runtime crash when it's time to validate if the current user (non-admin) is
allowed to perform a power operation on given a host via the APIv2.

The root cause of the crash is basically that search_for is called on
Host::Base by app/services/authorizer.rb:50.

Revision f30caf97 (diff)
Added by Julien Pivotto over 5 years ago

Fixes #8812 - Pass model type so search_for is called on Host

At least on version 1.6.1, the absence of this second parameter leads to a
runtime crash when it's time to validate if the current user (non-admin) is
allowed to perform a power operation on given a host via the APIv2.

The root cause of the crash is basically that search_for is called on
Host::Base by app/services/authorizer.rb:50.

(cherry picked from commit e02a2ff23dfec7361c688b469461cc1e926bba23)

History

#1 Updated by Dominic Cleal almost 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2013 added
  • Pull request deleted ()

#2 Updated by Dominic Cleal almost 6 years ago

  • Has duplicate Bug #6403: power API returns error if using a hostgroup_id search filter added

#3 Updated by Dominic Cleal over 5 years ago

  • Pull request https://github.com/theforeman/foreman/pull/2121 added
  • Pull request deleted (https://github.com/theforeman/foreman/pull/2013)

#4 Updated by Dominic Cleal over 5 years ago

  • Has duplicate Bug #9314: power-state change on vms in aws-compute resource cause 500 server error added

#5 Updated by Anonymous over 5 years ago

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

#6 Updated by Dominic Cleal over 5 years ago

  • Legacy Backlogs Release (now unused) set to 28

Also available in: Atom PDF