| 1 field_ui.module | field_ui_admin_access($access_callback, $access_arguments, $bundle_position = NULL, $bundle_value = NULL) |
Access callback to determine if a user is allowed to use the field UI.
Only grant access if the user has both the "administer fields" permission and is granted access by the entity specific restrictions.
Parameters
string $access_callback: The name of the access callback function to be called.
array $access_arguments: An array of arguments to pass to the access callback.
string|null $bundle_position: The position within the menu path that contains the bundle name. Note this is a string value because the menu substitutes integer values.
mixed|null $bundle_value: The substituted value of the bundle after performing any menu auto-loaders.
Return value
bool: TRUE if access to field UI pages is allowed, FALSE otherwise.
File
- core/
modules/ field_ui/ field_ui.module, line 452 - Allows administrators to attach custom fields to fieldable types.
Code
function field_ui_admin_access($access_callback, $access_arguments, $bundle_position = NULL, $bundle_value = NULL) {
// Perform variable substitution for the bundle. This would normally happen
// by the menu system replacing integers with the bundle value, but since the
// access callback is wrapped, the substitution needs to be done again before
// calling the child access callback.
$bundle_access_key = array_search((int) $bundle_position, $access_arguments, TRUE);
if ($bundle_access_key !== FALSE) {
$access_arguments[$bundle_access_key] = $bundle_value;
}
return user_access('administer fields') && call_user_func_array($access_callback, $access_arguments);
}