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 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 modules/
shortcut/ shortcut.module - Implements hook_menu().
File
-
modules/
shortcut/ shortcut.module, line 242
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.