mybuddy/api/permissions.py

15 lines
535 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from rest_framework.permissions import DjangoModelPermissions
2017-10-22 18:00:42 +00:00
class BabyBuddyDjangoModelPermissions(DjangoModelPermissions):
perms_map = {
2022-02-10 00:00:30 +00:00
"GET": ["%(app_label)s.view_%(model_name)s"],
"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'],
2022-02-10 00:00:30 +00:00
"PATCH": ["%(app_label)s.change_%(model_name)s"],
"DELETE": ["%(app_label)s.delete_%(model_name)s"],
}