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

Add build_context parameter to has_repo_or_repo_ver_param_model_or_obj_perms #5786

Open
git-hyagi opened this issue Sep 11, 2024 · 3 comments
Labels

Comments

@git-hyagi
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The has_repo_or_repo_ver_param_model_or_obj_perms function verifies only repository or repository_version as parameters. In pulp-container image build machinery, instead of repository_version, we are planning to add a field called build_context (where users would be passing a file repository_version href to be used as the build context of the image build process).

Describe the solution you'd like
Add support in has_repo_or_repo_ver_param_model_or_obj_perms to also validate the permissions based on build_context.

Describe alternatives you've considered
We thought about creating a new access condition function in pulp-container, but, to avoid the code repetition, maybe it would be better to keep using the pulpcore has_repo_or_repo_ver_param_model_or_obj_perms.
To workaround this "limitation" we are having to do something like:

data["repository_version"] = data["build_context"]
@lubosmj
Copy link
Member

lubosmj commented Sep 11, 2024

I would maybe allow plugin writers to create custom aliases or pass their own arguments to the function.

@mdellweg
Copy link
Member

@mdellweg
Copy link
Member

Maybe we add something like has_related_field_obj_permission:<fieldname>;<permission>.
I believe we only have one string to pass around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants