You are here

function token_custom_type_forms_access in Custom Tokens 7.2

Access callback for the delete token type form.

Do not allow deletion of the default custom type.

Parameters

object $type: The token type to edit/delete.

Return value

bool TRUE if user has permission AND type is not the default fixed one.

1 string reference to 'token_custom_type_forms_access'
token_custom_menu in ./token_custom.module
Implements of hook_menu().

File

./token_custom.module, line 202
It gives the user the ability to create custom tokens using PHP code for specific replacements that can improve other modules relying on the token Drupal 7 core API.

Code

function token_custom_type_forms_access($type) {
  return user_access('administer custom tokens') && $type->machine_name != TOKEN_CUSTOM_DEFAULT_TYPE;
}