function shortcut_set_edit_access

shortcut_set_edit_access($shortcut_set = NULL)

Access callback for editing a shortcut set.

Parameters

object $shortcut_set: (optional) The shortcut set to be edited. If not set, the current user's shortcut set will be used.

Return value

TRUE if the current user has access to edit the shortcut set, FALSE otherwise.

File

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

Code

function shortcut_set_edit_access($shortcut_set = NULL) {
  // Sufficiently-privileged users can edit their currently displayed shortcut
  // set, but not other sets. Shortcut administrators can edit any set.
  if (user_access('administer shortcuts')) {
    return TRUE;
  }
  if (user_access('customize shortcut links')) {
    return !isset($shortcut_set) || $shortcut_set == shortcut_current_displayed_set();
  }
  return FALSE;
}

© 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_edit_access/7.x