function shortcut_set_edit_access
Same name in other branches
- 9 core/modules/shortcut/shortcut.module \shortcut_set_edit_access()
- 8.9.x core/modules/shortcut/shortcut.module \shortcut_set_edit_access()
- 10 core/modules/shortcut/shortcut.module \shortcut_set_edit_access()
- 11.x core/modules/shortcut/shortcut.module \shortcut_set_edit_access()
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.
3 calls to shortcut_set_edit_access()
- shortcut_link_access in modules/
shortcut/ shortcut.module - Access callback for editing a link in a shortcut set.
- shortcut_preprocess_page in modules/
shortcut/ shortcut.module - Implements hook_preprocess_page().
- shortcut_toolbar_pre_render in modules/
shortcut/ shortcut.module - Pre-render function for adding shortcuts to the toolbar drawer.
1 string reference to 'shortcut_set_edit_access'
- shortcut_menu in modules/
shortcut/ shortcut.module - Implements hook_menu().
File
-
modules/
shortcut/ shortcut.module, line 220
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.