function shortcut_set_delete_access

Access callback for deleting a shortcut set.

Parameters

$shortcut_set: The shortcut set to be deleted.

Return value

TRUE if the current user has access to delete shortcut sets and this is not the site-wide default set; FALSE otherwise.

1 call to shortcut_set_delete_access()
shortcut_set_admin in drupal/modules/shortcut/shortcut.admin.inc
Menu page callback: builds the page for administering shortcut sets.
1 string reference to 'shortcut_set_delete_access'
shortcut_menu in drupal/modules/shortcut/shortcut.module
Implements hook_menu().

File

drupal/modules/shortcut/shortcut.module, line 242
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_set_delete_access($shortcut_set) {

  // Only admins can delete sets.
  if (!user_access('administer shortcuts')) {
    return FALSE;
  }

  // Never let the default shortcut set be deleted.
  if ($shortcut_set->set_name == SHORTCUT_DEFAULT_SET_NAME) {
    return FALSE;
  }
  return TRUE;
}