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

Use url parameter in repository access condition #1800

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

mdellweg
Copy link
Member

@mdellweg mdellweg commented Jan 7, 2022

fixes TBA
[noissue]

@mdellweg mdellweg marked this pull request as draft January 7, 2022 10:41
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 7, 2022
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 7, 2022
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 12, 2022
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 12, 2022
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 12, 2022
@mdellweg mdellweg force-pushed the access_conditions branch 2 times, most recently from 670fab7 to 8d6bd8c Compare January 12, 2022 17:33
@mdellweg mdellweg marked this pull request as ready for review January 12, 2022 17:34
@pulp pulp deleted a comment from pulpbot Jan 12, 2022
@mdellweg mdellweg changed the title WIP: Use url parameter in repository access condition Use url parameter in repository access condition Jan 12, 2022
@mdellweg mdellweg force-pushed the access_conditions branch 2 times, most recently from 03a3383 to 7b2af59 Compare January 13, 2022 09:40
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 13, 2022
@pulp pulp deleted a comment from pulpbot Jan 13, 2022
@pulpbot
Copy link
Member

pulpbot commented Jan 13, 2022

Attached issue: https://pulp.plan.io/issues/9670

Copy link
Contributor

@gerrod3 gerrod3 left a comment

Choose a reason for hiding this comment

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

What difference do these new methods have compared to has_repo_attr_obj_perms? Also, that method shortens repository so should these new ones shorten it as well?

@mdellweg
Copy link
Member Author

The difference is, that you don not need a detailed object with a repository attribute, but you can apply it to all actions that are nested under a repository viewset. The prime example is RepositoryVersionViewset where the list action could not use the existing condition.

mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 21, 2022
Copy link
Contributor

@gerrod3 gerrod3 left a comment

Choose a reason for hiding this comment

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

Every plugin will need these for implementing RBAC, but I wonder if there are any other objects across Pulp and its plugins that needs similar helper methods? (Maybe exporters/importers?)

mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 24, 2022
@@ -280,6 +280,68 @@ def has_repo_attr_model_or_obj_perms(request, view, action, permission):
return False


def has_repository_obj_perms(request, view, action, permission):
Copy link
Member

Choose a reason for hiding this comment

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

We don't have to import these through the plugin API do we?

Copy link
Member

Choose a reason for hiding this comment

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

@mdellweg if ^ is correct go ahead and merge plz.

Copy link
Member Author

Choose a reason for hiding this comment

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

no

Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

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

Thanks!

@mdellweg mdellweg merged commit 187ab3a into pulp:main Jan 25, 2022
@mdellweg mdellweg deleted the access_conditions branch January 25, 2022 15:47
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 28, 2022
mdellweg added a commit to mdellweg/pulp_container that referenced this pull request Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants