cmsmanage/cmsmanage/drf_permissions.py

11 lines
315 B
Python

import copy
from rest_framework.permissions import DjangoModelPermissions
class DjangoModelPermissionsWithView(DjangoModelPermissions):
def __init__(self):
super().__init__()
self.perms_map = copy.deepcopy(self.perms_map)
self.perms_map["GET"] = ["%(app_label)s.view_%(model_name)s"]