jazzband / django-authority

A Django app that provides generic per-object-permissions for Django's auth app and helpers to create custom permission checks.
http://django-authority.readthedocs.org
BSD 3-Clause "New" or "Revised" License
292 stars 57 forks source link

What is the right way to get permission class by model class? #60

Open alexitkes opened 6 years ago

alexitkes commented 6 years ago

Hello everyone.

If I called authority.sites.register (ModelClass, PermissionClass), I can later call other methods from authority.sites to retrieve the list of all permission names of PermissionClass and to retrieve the specific check function. But I am sorry, but I can't understand is there a good way to retrieve the PermissionClass itself if I only have the ModelClass. Is there a good way to do it without diving deep into the internal data of authority.sites module?

Thank you.

Alex.