Project

General

Profile

Bug #3595

Foreman 1.3.0: Creating a new hostgroup with included puppet Classes as an non admin user fails

Added by Peter Gustafsson almost 7 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
Users, Roles and Permissions
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Creating a new hostgroup with included puppet Classes as an non admin user fails with below trace:
ActiveRecord::RecordNotSaved
ActiveRecord::RecordNotSaved
app/controllers/hostgroups_controller.rb:61:in `create'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

And below is from production log:
Started POST "/hostgroups" for 192.168.122.10 at 2013-11-06 13:20:35 +0100
Processing by HostgroupsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"pvYwrj4pU1xLv221N4oIa1GUOV2sCluMpJoaf0lsuIk=", "hostgroup"=>{"parent_id"=>"98", "name"=>"pgustafs1 ", "environment_id"=>"4", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>["", "40", "380", "32", "80", "15", "97", "85", "55"], "domain_id"=>"2", "subnet_id"=>"", "architecture_id"=>"1", "operatingsystem_id"=>"1", "medium_id"=>"6", "ptable_id"=>"11", "root_pass"=>"[FILTERED]", "location_ids"=>["", "1", ""], "organization_ids"=>["", "2", ""]}, "commit"=>"Submit"}
Operation FAILED: ActiveRecord::RecordNotSaved
Rendered common/500.html.erb within layouts/application (3.5ms)
Completed 500 Internal Server Error in 74ms (Views: 5.8ms | ActiveRecord: 21.9ms)

The user is assigned an role with all permissions selected.

However if i do it in two steps it works:
1. Create a new hostgroup with no included puppet classes.
2. Edit the newly created hostgroup and include puppet classes.


Related issues

Related to Foreman - Bug #3549: hostgroups can only be edited by a user with Administrator rightsResolved2013-10-30

History

#1 Updated by Dominic Cleal almost 7 years ago

  • Related to Bug #3549: hostgroups can only be edited by a user with Administrator rights added

#2 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Feedback

I've tested this on Foreman 1.5 and believe the issue has been resolved. A basic user with create_hostgroups, edit_hostgroups and edit_classes (from "Host class") permissions on a role is able to create a host group with classes, and assign classes to an existing group.

We're running a test period for the new auth system in Foreman 1.5, so if you have opportunity to test it, your feedback would be appreciated. More info at Auth_testing_for_Foreman_15.

#3 Updated by Anonymous about 3 years ago

  • Status changed from Feedback to Resolved

should be fixed with 1.5+

Also available in: Atom PDF