Only show metrics dashboard pane if the user has access to metrics.
This commit is contained in:
parent
14b72d7930
commit
209cb5e48a
|
@ -8,13 +8,15 @@
|
|||
* Implements hook_farm_dashboard_panes().
|
||||
*/
|
||||
function farm_metrics_farm_dashboard_panes() {
|
||||
return array(
|
||||
'farm_metrics' => array(
|
||||
$panes = array();
|
||||
if (user_access('access farm metrics')) {
|
||||
$panes['farm_metrics'] = array(
|
||||
'title' => t('Metrics'),
|
||||
'callback' => 'farm_metrics_dashboard_pane',
|
||||
'group' => 'metrics',
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
return $panes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@ function farm_metrics_hook_info() {
|
|||
function farm_metrics_permission() {
|
||||
$perms = array(
|
||||
'access farm metrics' => array(
|
||||
'title' => t('Access the farmOS metrics endpoint'),
|
||||
'title' => t('Access farm metrics'),
|
||||
),
|
||||
);
|
||||
return $perms;
|
||||
|
|
Loading…
Reference in New Issue