kmmbvnr / django-guardian-ng

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

Assign permission to any object of a type #34

Closed kmmbvnr closed 5 months ago

kmmbvnr commented 5 months ago

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

kmmbvnr commented 5 months ago

Probably all ali could be unified to use model level permission under the hood, so to make obj= parameter is optinal

UserObjectPermission.objects.assign_perm('change_website', website_44_editors, obj=website_44)
website_44_editors.has_perm('change_website', website_44)

####### This doesn't work, as an object is needed #######
UserObjectPermission.objects.assign_perm('change_website', admins)