Skip to content

Commit

Permalink
Adding missing permission for accessing telemetry data.
Browse files Browse the repository at this point in the history
  • Loading branch information
quicksketch committed Aug 28, 2021
1 parent a0b5b11 commit 5834bed
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion project_telemetry/project_telemetry.module
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ function project_telemetry_menu() {
*/
function project_telemetry_access($node, $account = NULL) {
$access = user_access('access project telemetry data', $account);
return $access && ($node->type === 'project' || $node->type === 'project_release');
return $access && $node->type === 'project' && !empty($node->project['telemetry']['enabled']);
}

/**
* Implements hook_permission().
*/
function project_telemetry_permission() {
return array(
'access project telemetry data' => array(
'title' => t('Access project telemetry data'),
'description' => t('View the collected data from installed projects through the Telemetry module.'),
),
);
}

/**
Expand Down

0 comments on commit 5834bed

Please sign in to comment.