diff options
| author | Tom Christie | 2012-04-11 17:38:47 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-04-11 17:38:47 +0100 |
| commit | 4739e1c012526c3ed9835d908d6d7eff5e3c48f6 (patch) | |
| tree | 800f2133bf50449e2698f562d5d1d2dd199168e3 /djangorestframework/views.py | |
| parent | 44df8345f3ffcba141ded3a1bd993971d7199164 (diff) | |
| parent | 1ff741d1ccc38f099a7159bdef787e5c04dc4f79 (diff) | |
| download | django-rest-framework-4739e1c012526c3ed9835d908d6d7eff5e3c48f6.tar.bz2 | |
Merge work from sebpiq
Diffstat (limited to 'djangorestframework/views.py')
| -rw-r--r-- | djangorestframework/views.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/djangorestframework/views.py b/djangorestframework/views.py index 46223a3f..8fe5f99a 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -67,7 +67,7 @@ _resource_classes = ( ) -class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): +class View(ResourceMixin, RequestMixin, ResponseMixin, PermissionsMixin, DjangoView): """ Handles incoming requests and maps them to REST operations. Performs request deserialization, response serialization, authentication and input validation. @@ -90,7 +90,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): """ authentication = (authentication.UserLoggedInAuthentication, - authentication.BasicAuthentication) + authentication.BasicAuthentication) """ List of all authenticating methods to attempt. """ @@ -215,6 +215,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): def dispatch(self, request, *args, **kwargs): request = self.create_request(request) self.request = request + self.args = args self.kwargs = kwargs self.headers = self.default_response_headers @@ -222,8 +223,8 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): try: self.initial(request, *args, **kwargs) - # Authenticate and check request has the relevant permissions - self._check_permissions() + # check that user has the relevant permissions + self.check_permissions(request.user) # Get the appropriate handler method if request.method.lower() in self.http_method_names: |
