mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 12:22:23 -06:00
Extend menu items and buttons to accept a list of required permissions
This commit is contained in:
@@ -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
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user