mybuddy/api/permissions.py

17 lines
542 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework.permissions import DjangoModelPermissions
class BabyBlotterDjangoModelPermissions(DjangoModelPermissions):
perms_map = {
'GET': ['%(app_label)s.view_%(model_name)s'],
'OPTIONS': [],
'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'],
}