Provisioning templates no longer resolve/available for non-admin users in Foreman 1.7.5
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?
#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?
#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.