diff options
| author | Tom Christie | 2012-08-24 20:57:10 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-08-24 20:57:10 +0100 |
| commit | 87b363f7bc5f73d850df123a61895d65ec0b05e7 (patch) | |
| tree | 1993adba1ad6a01c498c883babb157e3b4c7ee15 /djangorestframework/mixins.py | |
| parent | 4e4584a01a4cf67c23aec21088110cd477ba841b (diff) | |
| download | django-rest-framework-87b363f7bc5f73d850df123a61895d65ec0b05e7.tar.bz2 | |
Remove PermissionsMixin
Diffstat (limited to 'djangorestframework/mixins.py')
| -rw-r--r-- | djangorestframework/mixins.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py index d1014a84..28fa5847 100644 --- a/djangorestframework/mixins.py +++ b/djangorestframework/mixins.py @@ -15,7 +15,6 @@ from djangorestframework.response import Response, ImmediateResponse __all__ = ( # Base behavior mixins - 'PermissionsMixin', 'ResourceMixin', # Model behavior mixins 'ReadModelMixin', @@ -27,35 +26,6 @@ __all__ = ( ) -########## Permissions Mixin ########## - -class PermissionsMixin(object): - """ - Simple :class:`mixin` class to add permission checking to a :class:`View` class. - """ - - permissions_classes = () - """ - The set of permissions that will be enforced on this view. - - Should be a tuple/list of classes as described in the :mod:`permissions` module. - """ - - def get_permissions(self): - """ - Instantiates and returns the list of permissions that this view requires. - """ - return [p(self) for p in self.permissions_classes] - - # TODO: wrap this behavior around dispatch() - def check_permissions(self, user): - """ - Check user permissions and either raise an ``ImmediateResponse`` or return. - """ - for permission in self.get_permissions(): - permission.check_permission(user) - - ########## Resource Mixin ########## class ResourceMixin(object): |
