Extend menu items and buttons to accept a list of required permissions

This commit is contained in:
Jeremy Stretch
2020-03-26 16:04:12 -04:00
parent 84d2db0d35
commit e7f7b14214
4 changed files with 38 additions and 27 deletions

View File

@@ -201,6 +201,14 @@ def get_docs(model):
return mark_safe(content)
@register.filter()
def has_perms(user, permissions_list):
"""
Return True if the user has *all* permissions in the list.
"""
return user.has_perms(permissions_list)
#
# Tags
#