diff options
| author | JoseĢ Padilla | 2014-10-31 09:04:39 -0400 | 
|---|---|---|
| committer | Dougal Matthews | 2014-11-25 12:44:11 +0000 | 
| commit | 16d442dda3ee9d4ff40d067d76706959aac4c6a3 (patch) | |
| tree | 2f180dd2ba39e9bed2dea0bbadc85815a043b471 /docs/api-guide/permissions.md | |
| parent | cbb6799d2dc2d87e58e67e1044075319262a674b (diff) | |
| download | django-rest-framework-16d442dda3ee9d4ff40d067d76706959aac4c6a3.tar.bz2 | |
Use MkDocs meta.source to render source code links
Diffstat (limited to 'docs/api-guide/permissions.md')
| -rw-r--r-- | docs/api-guide/permissions.md | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/docs/api-guide/permissions.md b/docs/api-guide/permissions.md index 446e362e..f068f0f7 100644 --- a/docs/api-guide/permissions.md +++ b/docs/api-guide/permissions.md @@ -1,4 +1,4 @@ -<a class="github" href="permissions.py"></a> +source: permissions.py  # Permissions @@ -12,7 +12,7 @@ Permission checks are always run at the very start of the view, before any other  ## How permissions are determined -Permissions in REST framework are always defined as a list of permission classes.   +Permissions in REST framework are always defined as a list of permission classes.  Before running the main body of the view each permission in the list is checked.  If any permission check fails an `exceptions.PermissionDenied` exception will be raised, and the main body of the view will not run. @@ -220,9 +220,9 @@ As well as global permissions, that are run against all incoming requests, you c          def has_object_permission(self, request, view, obj):              # Read permissions are allowed to any request,              # so we'll always allow GET, HEAD or OPTIONS requests. -            if request.method in permissions.SAFE_METHODS:             +            if request.method in permissions.SAFE_METHODS:                  return True -     +              # Instance must have an attribute named `owner`.              return obj.owner == request.user | 
