function nicemessages_field_access in Nice messages 7.2
Same name and namespace in other branches
- 7 nicemessages.module \nicemessages_field_access()
Implements hook_field_access().
File
- ./
nicemessages.module, line 62 - Nicemessages module
Code
function nicemessages_field_access($op, $field, $entity_type, $entity, $account) {
if ($field['field_name'] == NICEMESSAGES_FIELDNAME) {
// Users with toggle nicemessages permission can edit their settings.
if ($op == 'edit') {
return user_access('toggle nicemessages', $account);
}
elseif ($op == 'view') {
return user_access('administer users');
}
}
return TRUE;
}