I am trying to set up object-level permissions using Django guardian and groups; where I give permissions to the groups - not the users - and add/remove users from the groups as required.
When a user has permission to interact with an object instance - because they are in a group that has the necessary permissions - how can I determine which of the user's groups gave them the permission?
As an example, building off the example in the django-guardian-docs , ideally there would be something like:
>>> joe.has_perm_from_groups('sites.change_site', site)
[site_owners_group]