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
06a1e12f
Commit
06a1e12f
authored
Feb 28, 2017
by
tdruez
Committed by
GitHub
Feb 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Permissions.get_required_object_permissions for #4927
parent
b936d829
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
rest_framework/permissions.py
+9
-0
No files found.
rest_framework/permissions.py
View file @
06a1e12f
...
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
...
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
from
django.http
import
Http404
from
django.http
import
Http404
from
rest_framework
import
exceptions
from
rest_framework.compat
import
is_authenticated
from
rest_framework.compat
import
is_authenticated
...
@@ -108,6 +109,10 @@ class DjangoModelPermissions(BasePermission):
...
@@ -108,6 +109,10 @@ class DjangoModelPermissions(BasePermission):
'app_label'
:
model_cls
.
_meta
.
app_label
,
'app_label'
:
model_cls
.
_meta
.
app_label
,
'model_name'
:
model_cls
.
_meta
.
model_name
'model_name'
:
model_cls
.
_meta
.
model_name
}
}
if
method
not
in
self
.
perms_map
:
raise
exceptions
.
MethodNotAllowed
(
method
)
return
[
perm
%
kwargs
for
perm
in
self
.
perms_map
[
method
]]
return
[
perm
%
kwargs
for
perm
in
self
.
perms_map
[
method
]]
def
has_permission
(
self
,
request
,
view
):
def
has_permission
(
self
,
request
,
view
):
...
@@ -169,6 +174,10 @@ class DjangoObjectPermissions(DjangoModelPermissions):
...
@@ -169,6 +174,10 @@ class DjangoObjectPermissions(DjangoModelPermissions):
'app_label'
:
model_cls
.
_meta
.
app_label
,
'app_label'
:
model_cls
.
_meta
.
app_label
,
'model_name'
:
model_cls
.
_meta
.
model_name
'model_name'
:
model_cls
.
_meta
.
model_name
}
}
if
method
not
in
self
.
perms_map
:
raise
exceptions
.
MethodNotAllowed
(
method
)
return
[
perm
%
kwargs
for
perm
in
self
.
perms_map
[
method
]]
return
[
perm
%
kwargs
for
perm
in
self
.
perms_map
[
method
]]
def
has_object_permission
(
self
,
request
,
view
,
obj
):
def
has_object_permission
(
self
,
request
,
view
,
obj
):
...
...
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