mirror of https://github.com/interlegis/sapl.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
709 B
18 lines
709 B
from rest_framework.permissions import DjangoModelPermissions
|
|
|
|
|
|
class DjangoModelPermissions(DjangoModelPermissions):
|
|
|
|
perms_map = {
|
|
'GET': ['%(app_label)s.list_%(model_name)s',
|
|
'%(app_label)s.detail_%(model_name)s'],
|
|
'OPTIONS': ['%(app_label)s.list_%(model_name)s',
|
|
'%(app_label)s.detail_%(model_name)s'],
|
|
'HEAD': ['%(app_label)s.list_%(model_name)s',
|
|
'%(app_label)s.detail_%(model_name)s'],
|
|
'POST': ['%(app_label)s.list_%(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'],
|
|
|
|
}
|
|
|