Closed luisza closed 6 years ago
Hi, based in this #62 issue I create a functionality that check if perm is a function and if it's call the function, so now it's possible to have a custom permission mechanism.
See http://django-cruds-adminlte.readthedocs.io/en/latest/usage.html#permissions , now only text permission are sopported and always call user.has_perm(xxx), but with this pull request it's possible to do:
def mypermsystem(user, view): # view is one of this 'list', 'add', 'update', 'detail' return True or False class Myclass(CRUDView): model = Customer perms = { 'create': ['applabel.mycustom_perm'], 'list': [mypermsystem], 'delete': [], 'update': [], 'detail': [] }
Hi, based in this #62 issue I create a functionality that check if perm is a function and if it's call the function, so now it's possible to have a custom permission mechanism.
See http://django-cruds-adminlte.readthedocs.io/en/latest/usage.html#permissions , now only text permission are sopported and always call user.has_perm(xxx), but with this pull request it's possible to do: