Allow all farm roles to access metrics.

This commit is contained in:
Michael Stenta 2020-02-26 10:16:08 -05:00
parent 1db1671256
commit 41758a29d2
1 changed files with 5 additions and 9 deletions

View File

@ -30,16 +30,12 @@ function farm_metrics_permission() {
* Implements hook_farm_access_perms(). * Implements hook_farm_access_perms().
*/ */
function farm_metrics_farm_access_perms($role) { function farm_metrics_farm_access_perms($role) {
// Load the list of farm roles. $perms = array();
$roles = farm_access_roles();
// If this role has 'config' access, grant area generator access. // Access farm metrics.
if (!empty($roles[$role]['access']['config'])) { $perms[] = 'access farm metrics';
return array('access farm metrics');
} return $perms;
else {
return array();
}
} }
/** /**