-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: wrong policy ACLs when access Job Templates/Nomad Variables #23438
Comments
Hi @Mac2! This looks like it's probably an issue with the logic in the UI to hide the button, rather than the ACL policy itself being managed incorrectly. I'm going to flag this for @philrenaud to see if he has thoughts on it. |
Hi @Mac2 — we chose to put job templates within the You can view these templates (and edit them, if you have If there's a good use-case for users who can manage/write job template variables but who don't themselves shouldn't have job run access, I'd consider moving template gallery page elsewhere in the UI, but my hope is that it's in the most appropriate place today. |
Hi @philrenaud , I've just noticed that I missed an importand fact ... in my test-policy there was also included a write-permission for another namespace (policy=write). So the user has access to "Run Job", but the "Choose Template" Button is only missing. So it look for me that this button checks explicitly für "write variable", instead of "read variable". So in my testcase mentioned above I was able to read the templates, but can not create new ones (except the "notexisting" dummy in default ns of course) thanks, |
Thank you so much for the detail, @Mac2 . I've put up a PR that should improve this situation generally:
I hope that you find this change addresses your need. I found your example ACL policy helpful to test with, and included my own in the PR description in case you wanted to check if the new change works for you. |
Sorry for the long delay, due to vacation ... many thanks for applying this code change so fast. thanks, |
Nomad version
Nomad v1.8.1
BuildDate 2024-06-19T06:43:57Z
Revision 5022543
Operating system and Environment details
RHEL 8.6 - RHEL 8.8
Issue
We try to give users access to some Job Templates via UI.
As I understand the templates (beside the default ones) are stored as Nomad Variables. So I added the following ACLs to the user policy:
with this Policy read-only access works as expected. But without the second write-capability, the "choose template/upload template" Button when trying to "Run a Job" is gone.
As my policy suggest, the path of the write-capability is not existing. So it looks like the check for the Buttonvisibility only looks for the presence of any write-capability.
I've also checked with different namespaces ... I need the write-capability only once a namespace, and then it works as expected.
If I check the "Variables" page, I could see the "nomad/job-templates" path as expected, and also access the stored custom template values. So it might only be a problem with the ui-buttons, and not with the underlying permissions checks.
Reproduction steps
-> no Choose template button accessible
Expected Result
"Choose Template" Button should be available also with read-only permissions
And maybe access to default templates should be possible without access to nomad Variables?
Actual Result
Button is only useable if at least one write permission is granted
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
thanks,
Mac
The text was updated successfully, but these errors were encountered: