Don't show workspace nav items the user doesn't have access to

This commit is contained in:
Patrick Smith 2018-09-30 22:19:26 -04:00
parent 7b2a099ef3
commit aa42f5671c

View File

@ -16,6 +16,7 @@
]
) }}
{% if user_can(permissions.VIEW_WORKSPACE_MEMBERS) %}
{{ SidenavItem(
"Members",
href=url_for("workspaces.workspace_members", workspace_id=workspace.id),
@ -29,12 +30,15 @@
}
]
) }}
{% endif %}
{% if user_can(permissions.VIEW_USAGE_DOLLARS) %}
{{ SidenavItem(
"Budget Report",
href=url_for("workspaces.workspace_reports", workspace_id=workspace.id),
active=request.url_rule.rule.startswith('/workspaces/<workspace_id>/reports')
) }}
{% endif %}
{% if user_can(permissions.EDIT_WORKSPACE_INFORMATION) %}
{{ SidenavItem(