function shortcut_set_delete_access

shortcut_set_delete_access($shortcut_set)

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.

File

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!shortcut!shortcut.module/function/shortcut_set_delete_access/7.x