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

Removed addressing AccessPolicy via the viewset's classname. #1181

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

ipanova
Copy link
Member

@ipanova ipanova commented Mar 12, 2021

closes #8397
closes #8395

Please be sure you have read our documentation on creating PRs:
https://docs.pulpproject.org/contributing/pull-request-walkthrough.html

@pulpbot
Copy link
Member

pulpbot commented Mar 12, 2021

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

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

return access_policy_obj.statements
return access_policy_obj.statements
except AccessPolicyModel.DoesNotExist:
return []
Copy link
Member

Choose a reason for hiding this comment

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

BTW, i just realized, that the docstring of this function is lying.

@@ -23,7 +21,7 @@ def get_policy_statements(self, request, view):
The `pulpcore.plugin.models.AccessPolicy` instance is looked up by the `viewset_name`
attribute using::

AccessPolicyModel.objects.get(viewset_name=view.__model__.__name__)
AccessPolicyModel.objects.get(viewset_name=get_view_urlpattern(view))
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1 @@
It is not longer possible to address AccessPolicy via the viewset's classname. Viewset's urlpattern should be used instead.
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to mention that it's deprecated, so it doesn't look scary, as we just removed it?

Copy link
Member

Choose a reason for hiding this comment

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

up to you, I do not need to re-review

@ipanova ipanova merged commit 49dfcb1 into pulp:master Mar 15, 2021
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