Project

General

Profile

Bug #10918

Provisioning templates no longer resolve/available for non-admin users in Foreman 1.7.5

Added by Tomasz Nowak almost 6 years ago. Updated over 3 years ago.

Status:
Feedback
Priority:
High
Assignee:
-
Category:
Organizations and Locations
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

After upgrading Foreman from 1.7.4 -> 1.7.5, provisioning templates are no longer resolvable/usable for non-admin users trying to provision new machines.

It seems "All templates" check box in Organization tab is not being correctly applied when user belong to many Organizations and when user context is set to "Any Organization".

Changes in app/models/concerns/taxonomix.rb seem to have caused the regression:

diff app/models/concerns/taxonomix.rb app_1.7.5/models/concerns/taxonomix.rb
80c80
<       if SETTINGS[:organizations_enabled] && org
---
>       if SETTINGS[:organizations_enabled] && org.present?

Related issues

Related to Foreman - Bug #9947: CVE-2015-1844 - GET /api/hosts doesn't respect organization/location membershipClosed2015-03-30

History

#1 Updated by Dominic Cleal almost 6 years ago

  • Description updated (diff)
  • Category set to Organizations and Locations

The change you mention in the diff is pretty much meaningless in this context, I can't see how it'd have any effect. Did reverting it fix the issue for you?

Another recently fixed issue was #10342, which prevented any host with parameters from resolving templates. Perhaps that's it?

#2 Updated by Dominic Cleal almost 6 years ago

Oh, re-reading then it's probably related to #9947 which changed multi-org lookups.

#3 Updated by Dominic Cleal almost 6 years ago

  • Related to Bug #9947: CVE-2015-1844 - GET /api/hosts doesn't respect organization/location membership added

#4 Updated by Tomasz Nowak almost 6 years ago

The issue expose itself only if you are non-admin, belong to many organizations, organizations have "All templates" box checked and your context is "Any Organization".
In that case you won't be able to to provisions any hosts with the error message:

"
Unable to save
No PXELinux templates were found for this host, make sure you define at least one in your ... settings
"

Reverting the foreman to 1.7.4 fixed the issue.
I'm thinking now on upgrading to 1.7.5 again for security fixes but manually add each template to organizations instead of using "All templates" box as a workaround.

#5 Updated by Anonymous almost 4 years ago

what's the status here with current versions?

#6 Updated by Anonymous over 3 years ago

  • Status changed from New to Feedback

Also available in: Atom PDF