Skip to content

Overriding of perms_map in subclasses of DjangoModelPermissions #8756

Discussion options

You must be logged in to vote

Hmm, yeah actually just creating a copy is already sufficient:

class PermsWithView(permissions.DjangoModelPermissions):
    def __init__(self):
        self.perms_map = super().perms_map.copy()
        self.perms_map['GET'] = ['%(app_label)s.view_%(model_name)s']

This question looks like just noise to me now, as this is just how Python behaves and not really a DRF issue.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hoefling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant