From e628d9eb9b7deac2ecffe23eace5c72709887f8f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 6 Mar 2015 12:05:16 +0000 Subject: Update documentation --- api-guide/permissions/index.html | 42 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 32 deletions(-) (limited to 'api-guide/permissions/index.html') diff --git a/api-guide/permissions/index.html b/api-guide/permissions/index.html index 7b6f889c..5e921802 100644 --- a/api-guide/permissions/index.html +++ b/api-guide/permissions/index.html @@ -188,6 +188,10 @@ Pagination +
  • + Versioning +
  • +
  • Content negotiation
  • @@ -231,6 +235,10 @@ Documenting your API +
  • + Internationalization +
  • +
  • AJAX, CSRF & CORS
  • @@ -260,23 +268,11 @@
  • - 2.0 Announcement -
  • - -
  • - 2.2 Announcement -
  • - -
  • - 2.3 Announcement -
  • - -
  • - 2.4 Announcement + 3.0 Announcement
  • - 3.0 Announcement + 3.1 Announcement
  • @@ -287,10 +283,6 @@ Release Notes
  • -
  • - Credits -
  • - @@ -405,10 +397,6 @@ DjangoObjectPermissions -
  • - TokenHasReadWriteScope -
  • - @@ -575,16 +563,6 @@ def example_view(request, format=None):

    Note: If you need object level view permissions for GET, HEAD and OPTIONS requests, you'll want to consider also adding the DjangoObjectPermissionsFilter class to ensure that list endpoints only return results including objects for which the user has appropriate view permissions.


    -

    TokenHasReadWriteScope

    -

    This permission class is intended for use with either of the OAuthAuthentication and OAuth2Authentication classes, and ties into the scoping that their backends provide.

    -

    Requests with a safe methods of GET, OPTIONS or HEAD will be allowed if the authenticated token has read permission.

    -

    Requests for POST, PUT, PATCH and DELETE will be allowed if the authenticated token has write permission.

    -

    This permission class relies on the implementations of the django-oauth-plus and django-oauth2-provider libraries, which both provide limited support for controlling the scope of access tokens:

    - -

    If you require more advanced scoping for your API, such as restricting tokens to accessing a subset of functionality of your API then you will need to provide a custom permission class. See the source of the django-oauth-plus or django-oauth2-provider package for more details on scoping token access.


    Custom permissions

    To implement a custom permission, override BasePermission and implement either, or both, of the following methods:

    -- cgit v1.2.3