Skip to content
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

Fixes #33340 - Pick first available template if the user can't see #647

Merged
merged 1 commit into from Aug 26, 2021

Conversation

adamruzicka
Copy link
Contributor

the one configured in settings

@ezr-ondrej
Copy link
Member

Aren't the returns breaking the if block_given??
In general I've bit of an issue with the premise of "user can't see template, so he can't run it".
I'd expect more him not to be able to see the specifics of the template, but if he has permission to execute jobs, I'd allow him to run the template...

@adamruzicka
Copy link
Contributor Author

Aren't the returns breaking the if block_given?

It is not really straightforward, but it seems to work just fine. The block is usually used to retrieve some information from the template (if found) and it is up to the caller to set the default properly.

I'd expect more him not to be able to see the specifics of the template, but if he has permission to execute jobs, I'd allow him to run the template...

Then you couldn't really limit what unprivileged users can run

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense 👍

@ezr-ondrej ezr-ondrej merged commit 843bd75 into master Aug 26, 2021
@ezr-ondrej ezr-ondrej deleted the template-preselect branch August 26, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants