diff options
| author | bwreilly | 2013-09-06 11:01:31 -0500 | 
|---|---|---|
| committer | bwreilly | 2013-09-06 11:01:31 -0500 | 
| commit | 4a9dcfa76089143bbeb5cd43fa3a406365d89e96 (patch) | |
| tree | 8643a0d9f4b0c3732321e1014a9b0b59141f5eaa /rest_framework/permissions.py | |
| parent | 551fe92078698005fd5a35cc14cef35baf1d2d71 (diff) | |
| download | django-rest-framework-4a9dcfa76089143bbeb5cd43fa3a406365d89e96.tar.bz2 | |
added guardian as optional requirement, stubbed out object-level permission class
Diffstat (limited to 'rest_framework/permissions.py')
| -rw-r--r-- | rest_framework/permissions.py | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index 1036663e..6d213ba1 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -7,7 +7,7 @@ import warnings  SAFE_METHODS = ['GET', 'HEAD', 'OPTIONS'] -from rest_framework.compat import oauth2_provider_scope, oauth2_constants +from rest_framework.compat import oauth2_provider_scope, oauth2_constants, guardian  class BasePermission(object): @@ -151,6 +151,11 @@ class DjangoModelPermissionsOrAnonReadOnly(DjangoModelPermissions):      authenticated_users_only = False +class DjangoObjectLevelModelPermissions(DjangoModelPermissions): +    def __init__(self): +        assert guardian, 'Using DjangoObjectLevelModelPermissions, but guardian is not installed' + +  class TokenHasReadWriteScope(BasePermission):      """      The request is authenticated as a user and the token used has the right scope | 
