Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
b2362419
Commit
b2362419
authored
Feb 11, 2012
by
Camille Harang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check authentication after checking ModelResource
parent
bc80eb26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
djangorestframework/permissions.py
+4
-4
No files found.
djangorestframework/permissions.py
View file @
b2362419
...
...
@@ -99,16 +99,16 @@ class DjangoModelPermisson(BasePermission):
if
self
.
view
.
request
.
method
in
(
'GET'
,
'OPTIONS'
,
'HEAD'
,):
return
# User must be logged in to check permissions.
if
not
hasattr
(
self
.
view
.
request
,
'user'
)
or
not
self
.
view
.
request
.
user
.
is_authenticated
():
raise
_403_FORBIDDEN_RESPONSE
klass
=
self
.
view
.
resource
.
model
# If it doesn't look like a model, we can't check permissions.
if
not
klass
or
not
getattr
(
klass
,
'_meta'
,
None
):
return
# User must be logged in to check permissions.
if
not
hasattr
(
self
.
view
.
request
,
'user'
)
or
not
self
.
view
.
request
.
user
.
is_authenticated
():
raise
_403_FORBIDDEN_RESPONSE
permission_map
=
{
'POST'
:
[
'
%
s.add_
%
s'
],
'PUT'
:
[
'
%
s.change_
%
s'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment