Merge pull request #3344 from erasche/expose-metrics

Expose metrics to non-admins
This commit is contained in:
John Chilton
2016-12-22 10:40:07 -05:00
committed by GitHub
3 changed files with 11 additions and 3 deletions
+6 -1
View File
@@ -1110,9 +1110,14 @@ use_interactive = True
#enable_quotas = False
# This option allows users to see the full path of datasets via the "View
# Details" option in the history. Administrators can always see this.
# Details" option in the history. This option also exposes the command line to
# non-administrative users. Administrators can always see dataset paths.
#expose_dataset_path = False
# This option allows users to see the job metrics (except for environment
# variables).
#expose_potentially_sensitive_job_metrics = False
# Data manager configuration options
# Allow non-admin users to view available Data Manager options.
#enable_data_manager_user_view = False
+1
View File
@@ -217,6 +217,7 @@ class Configuration( object ):
self.track_jobs_in_database = string_as_bool( kwargs.get( 'track_jobs_in_database', 'True') )
self.start_job_runners = listify(kwargs.get( 'start_job_runners', '' ))
self.expose_dataset_path = string_as_bool( kwargs.get( 'expose_dataset_path', 'False' ) )
self.expose_potentially_sensitive_job_metrics = string_as_bool( kwargs.get( 'expose_potentially_sensitive_job_metrics', 'False' ) )
self.enable_communication_server = string_as_bool( kwargs.get( 'enable_communication_server', 'False' ) )
self.communication_server_host = kwargs.get( 'communication_server_host', 'http://localhost' )
self.communication_server_port = int( kwargs.get( 'communication_server_port', '7070' ) )
+4 -2
View File
@@ -230,17 +230,18 @@
%if job and job.command_line and trans.user_is_admin():
%if job and job.command_line and (trans.user_is_admin() or trans.app.config.expose_dataset_path):
<h3>Command Line</h3>
<pre class="code">
${ job.command_line | h }</pre>
%endif
%if job and trans.user_is_admin():
%if job and (trans.user_is_admin() or trans.app.config.expose_potentially_sensitive_job_metrics):
<h3>Job Metrics</h3>
<% job_metrics = trans.app.job_metrics %>
<% plugins = set([metric.plugin for metric in job.metrics]) %>
%for plugin in sorted(plugins):
%if trans.user_is_admin() or plugin != 'env':
<h4>${ plugin | h }</h4>
<table class="tabletip info_data_table">
<tbody>
@@ -254,6 +255,7 @@ ${ job.command_line | h }</pre>
%endfor
</tbody>
</table>
%endif
%endfor
%endif