dfunckt / django-rules

Awesome Django authorization, without the database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Method to list all predicates/rules?

benwhalley opened this issue · comments

Is there way to list all registered predicates/rules, e.g. for the purposes of documenting permissions?

Yes, rules are registered in rulesets which are regular dicts. So you just need to import the ruleset and iterate over its keys/values. The permissions ruleset can be imported as from rules.permissions import permissions.

Cool - thanks.