This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
Add configuration to return False if of obj
is specifed but obj
is None.
#29
Labels
Currently when
obj
context is not exists in the template, something like{% if user has 'app_label.change_model' of obj %}
return non object permission.It is a correct behavior but usually non object permission should return
True
based on basic django concept (https://code.djangoproject.com/wiki/RowLevelPermissions) thus the following code will render links for chaning/deleting the object even if the accessed user does not have such permissions for the object.It is quite annoying thus add
PERMISSION_RETURN_FALSE_IF_NONE_IN_TEMPLATE
or whatever configuration and checkobj
value at https://github.com/lambdalisue/django-permission/blob/master/src/permission/templatetags/permissionif.py#L38 and returnFalse
ifof obj
keyword is specified butobj
is None.The text was updated successfully, but these errors were encountered: