mirror of https://github.com/snachodog/mybuddy.git
Disable unused API methods and require model add permissions for OPTIONS.
This commit is contained in:
parent
ed84f950bc
commit
c37dabdbd1
|
@ -7,10 +7,10 @@ from rest_framework.permissions import DjangoModelPermissions
|
|||
class BabyBuddyDjangoModelPermissions(DjangoModelPermissions):
|
||||
perms_map = {
|
||||
'GET': ['%(app_label)s.view_%(model_name)s'],
|
||||
'OPTIONS': [],
|
||||
'OPTIONS': ['%(app_label)s.add_%(model_name)s'],
|
||||
'HEAD': [],
|
||||
'POST': ['%(app_label)s.add_%(model_name)s'],
|
||||
'PUT': ['%(app_label)s.change_%(model_name)s'],
|
||||
'PATCH': ['%(app_label)s.change_%(model_name)s'],
|
||||
'DELETE': ['%(app_label)s.delete_%(model_name)s'],
|
||||
# 'PUT': ['%(app_label)s.change_%(model_name)s'],
|
||||
# 'PATCH': ['%(app_label)s.change_%(model_name)s'],
|
||||
# 'DELETE': ['%(app_label)s.delete_%(model_name)s'],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue