[FIX] ASSET: Permission to view asset history

This commit is contained in:
Horilla
2024-09-25 17:01:00 +05:30
parent fecb7d9487
commit 080df5b8b2

View File

@@ -26,6 +26,7 @@ SUBMENUS = [
{
"menu": trans("Asset History"),
"redirect": reverse("asset-history"),
"accessibility": "asset.sidebar.history_accessibility",
},
]
@@ -36,3 +37,11 @@ def dashboard_accessibility(request, submenu, user_perms, *args, **kwargs):
dashboard and asset category view.
"""
return request.user.has_perm("asset.view_assetcategory")
def history_accessibility(request, submenu, user_perms, *args, **kwargs):
"""
Determine if the user has the necessary permissions to access the
dashboard and asset category view.
"""
return request.user.has_perm("asset.view_assetassignment")