Skip to content

Commit

Permalink
Fix example for AccessPolicyFromDB
Browse files Browse the repository at this point in the history
Also fixed some typos.

[noissue]
  • Loading branch information
mdellweg committed Nov 26, 2020
1 parent 9b0c86e commit ad98ad0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/plugins/plugin-writer/concepts/rbac/access_policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ For example, here is the FileRemoteViewSet which enables authorization enforceme

.. code-block:: python
from pulpcore.plugin.access_policy import AccessPolicyFromDB
class FileRemoteViewSet(NamedModelViewSet):
...
permission_classes = (FileRemoteAccessPolicy,)
permission_classes = (AccessPolicyFromDB,)
...
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ use the ``pulpcore.plugin.models.AutoAddObjPermsMixin``. See the example below a
class MyModel(BaseModel, AutoAddObjPermsMixin):
ACCESS_POLICY_VIEWSET_NAME = "mymodel"
...
See the docstring below for more information on this mixin.
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/plugin-writer/concepts/rbac/queryset_scoping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ With limited object-level permissions on certain objects, its desirable to restr
shown to users. This effectively causes a Pulp system with many users to have each user see only
"their" permissions.

This is feature is generally referred to as Queryset Scoping because it is applied as an additional
This feature is generally referred to as Queryset Scoping because it is applied as an additional
filter on the base Queryset of a ViewSet. This causes the permission filtering to work with other
filterings applied by a user.

Expand All @@ -23,7 +23,7 @@ to a specific permission either at the model-level or object-level. Enable this
inherits from ``pulpcore.plugin.viewsets.NamedModelViewSet`` by setting the
``queryset_filtering_required_permission`` class attribute to the value of the permission name.

For example Tasks are restricted only to those users with the "core.task_viewtask" permission like
For example Tasks are restricted only to those users with the "core.view_task" permission like
this::

TaskViewSet(NamedModelViewSet):
Expand Down

0 comments on commit ad98ad0

Please sign in to comment.