kmmbvnr / django-guardian-ng

Per object permissions for Django
https://django-guardian.readthedocs.io/
Other
1 stars 0 forks source link

Assiging Permissions not Designed for the Class #9

Closed kmmbvnr closed 5 months ago

kmmbvnr commented 5 months ago

Original issue: https://github.com/django-guardian/django-guardian/issues/797

kmmbvnr commented 5 months ago

It seems debatable design decision. One of the solution withot code modification, could be adding custom persiions to a School class

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-permissions

class School(models.Model):
    ...

    class Meta:
        permissions = [
            ("add_homework", "Can add school homework"),
            ("add_notification", "Can create school  notifications"),
        ]