You are here

function farm_report_farm_access_perms in farmOS 7

Implements hook_farm_access_perms().

File

modules/farm/farm_report/farm_report.module, line 24
Farm report module.

Code

function farm_report_farm_access_perms($role) {
  $perms = array();

  // Add the "view farm reports" permission to all roles.
  $perms[] = 'view farm reports';

  // Load the list of farm roles.
  $roles = farm_access_roles();

  // If this role has 'config' access, allow them to configure farm reports.
  if (!empty($roles[$role]['access']['config'])) {
    $perms[] = 'configure farm reports';
  }
  return $perms;
}