function commons_groups_field_access in Drupal Commons 7.3
Implements hook_field_access().
File
- modules/
commons/ commons_groups/ commons_groups.module, line 1022
Code
function commons_groups_field_access($op, $field, $entity_type, $entity, $account) {
$field_name = $field['field_name'];
switch ($field_name) {
case 'og_roles_permissions':
return FALSE;
case 'field_og_access_default_value':
return $op == 'edit' && module_exists('og_access');
case 'field_og_subscribe_settings':
return $op == 'edit';
}
if (module_exists('og_access') && in_array($field_name, array(
OG_CONTENT_ACCESS_FIELD,
OG_ACCESS_FIELD,
))) {
return FALSE;
}
}