You are here

function taxonomy_farm_access_perms in farmOS 7

Implements hook_farm_access_perms().

File

modules/farm/farm_access/farm_access.farm_access.inc, line 81
Farm access hooks implemented by farm access module.

Code

function taxonomy_farm_access_perms($role) {

  // Use the helper function to generate a list of entity type bundles
  // permissions for the given role.
  $perms = farm_access_entity_bundles_role_perms('taxonomy_term', $role);

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

  // If the role has high-level 'edit' access of taxonomy terms, give them the
  // 'administer taxonomy' permission so that they can add terms.
  if (!empty($roles[$role]['access']['edit'])) {
    $perms[] = 'administer taxonomy';
  }
  return $perms;
}