Module: check_mk
Branch: master
Commit: ecf6528e251b8f76abe939100617b4e5f961cdea
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ecf6528e251b8f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 3 15:22:18 2016 +0100
Show button [Export as PDF] only if user has permission "Use Reporting"
This is part of Werk #8619
Conflicts:
web/plugins/views/availability.py
---
web/htdocs/views.py | 2 +-
web/plugins/views/availability.py | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 8c30636..862c117 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2219,7 +2219,7 @@ def show_context_links(thisview, show_filters,
bestof = config.context_buttons_to_show)
# Button for creating an instant report (if reporting is available)
- if config.reporting_available():
+ if config.reporting_available() and config.may("general.reporting"):
html.context_button(_("Export as PDF"), html.makeuri([],
filename="report_instant.py"), "report")
# Buttons to other views, dashboards, etc.
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 618e3d6..8591b20 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -221,8 +221,7 @@ def render_availability_page(view, datasource, filterheaders,
only_sites, limit)
html.begin_context_buttons()
togglebutton("avoptions", html.has_user_errors(),
"painteroptions", _("Configure details of the report"))
html.context_button(_("Status View"), html.makeuri([("mode",
"status")]), "status")
-
- if config.reporting_available():
+ if config.reporting_available() and config.may("general.reporting"):
html.context_button(_("Export as PDF"), html.makeuri([],
filename="report_instant.py"), "report")
if av_mode == "table":
@@ -511,7 +510,7 @@ def render_bi_availability(title, aggr_rows):
html.begin_context_buttons()
togglebutton("avoptions", False, "painteroptions",
_("Configure details of the report"))
html.context_button(_("Status View"), html.makeuri([("mode",
"status")]), "status")
- if config.reporting_available():
+ if config.reporting_available() and config.may("general.reporting"):
html.context_button(_("Export as PDF"), html.makeuri([],
filename="report_instant.py"), "report")
if av_mode == "availability":
html.context_button(_("Export as CSV"),
html.makeuri([("output_format", "csv_export")]),
"download_csv")