add permission check for can_create_projects

This commit is contained in:
Andrew Croce 2018-09-20 15:12:33 -04:00
parent df68d33f35
commit 14daa16ef0

View File

@ -104,6 +104,8 @@
{% set reports_url = url_for("workspaces.workspace_reports", workspace_id=workspace.id) %} {% set reports_url = url_for("workspaces.workspace_reports", workspace_id=workspace.id) %}
{% if not monthly_totals['environments'] %} {% if not monthly_totals['environments'] %}
{% set can_create_projects = user_can(permissions.ADD_APPLICATION_IN_WORKSPACE) %}
{% set message = 'This Workspace has no Cloud Environments setup, hence there is no spending data to report. Create a Project with some Cloud Environments to get started.' {% set message = 'This Workspace has no Cloud Environments setup, hence there is no spending data to report. Create a Project with some Cloud Environments to get started.'
if can_create_projects if can_create_projects
else 'This Workspace has no Cloud Environments setup, hence there is no spending data to report. Contact the Workspace Owner to set up some Cloud Environments.' else 'This Workspace has no Cloud Environments setup, hence there is no spending data to report. Contact the Workspace Owner to set up some Cloud Environments.'