dfunckt / django-rules

Awesome Django authorization, without the database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Equivalant of `rules.add_perm('model', rules.always_allow)` in model.Meta.rules_permissions

keyvanm opened this issue · comments

Hi, amazing library. It is entirely changing the way I'm handling permissions in my Django apps. I'm wondering is there a way to specify the permissions that allow showing the model in the admin dashboard in model's meta class?

rules.add_perm('books', rules.always_allow)
class Book(RulesModel):
    class Meta:
        rules_permissions = {
            "add": rules.is_staff,
            "read": rules.is_authenticated,
        }

nvm, didn't realize the permission was there for the whole app to show up, not just a model