-
Notifications
You must be signed in to change notification settings - Fork 107
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
Conversation
Attached issue: https://pulp.plan.io/issues/8397 Attached issue: https://pulp.plan.io/issues/8395 |
pulpcore/app/access_policy.py
Outdated
return access_policy_obj.statements | ||
return access_policy_obj.statements | ||
except AccessPolicyModel.DoesNotExist: | ||
return [] |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
closes #8397 closes #8395
@@ -0,0 +1 @@ | |||
It is not longer possible to address AccessPolicy via the viewset's classname. Viewset's urlpattern should be used instead. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
closes #8397
closes #8395
Please be sure you have read our documentation on creating PRs:
https://docs.pulpproject.org/contributing/pull-request-walkthrough.html