Bug #3076
closed
Foreman 1.2.2: Non Admin user fails to override parameters when creating a new hosts.
Added by Peter Gustafsson almost 11 years ago.
Updated almost 11 years ago.
Category:
Users, Roles and Permissions
|
Description
Hi,
Non Admin user fails to override parameters when creating a new host. In the web UI New Host => parameters it looks ok, i can push the override button and set a new value to the parameter.
But after the machine is provisioned the new value is not set on the host and the YAML file for the host contains the old parameter value.
The user that i tried this with is assigned an role with all permissions granted.
- Category set to Users, Roles and Permissions
- Priority changed from Normal to High
- Target version set to 1.3.0
I see what's happeneing here...
The issue is at http://projects.theforeman.org/projects/foreman/repository/revisions/develop/annotate/app/models/lookup_value.rb#L65 - under normal circumstances $1 will indeed be part of Host.my_hosts (or it isn't and we should deny the update). However, during host creation, the new Host object hasn't been saved to the DB yet, so this check fails, and we get permission denied on creating the matcher.
The fix is less obvious. This method seems to know nothing about the state of the new Host object (new_record? etc. all apply to the new lookup_value object). I'm not sure how we can check if we're in the process of creating a new Host, and return true if so.
Joseph, any ideas?
I updated PR https://github.com/theforeman/foreman/pull/903
A new host will not be found in the list of all existing hosts so this will be allow
It will only return false if the host_name exists but it does NOT belong to the user.
Does this make this?
- Status changed from New to Ready For Testing
- Assignee set to Joseph Magen
- Related to Tracker #3112: [TRACKER] Issues to be released in 1.3 RC or final added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to deleted (Tracker #3112: [TRACKER] Issues to be released in 1.3 RC or final)
Also available in: Atom
PDF