You are here

function _fullcalendar_update_access in FullCalendar 7

Same name and namespace in other branches
  1. 6.2 fullcalendar.module \_fullcalendar_update_access()
  2. 6 fullcalendar.module \_fullcalendar_update_access()
  3. 7.2 fullcalendar.module \_fullcalendar_update_access()

Checks if the user has access to update the given FullCalendar event.

Parameters

$node: The node that will be updated.

Return value

TRUE if the user is allowed to update the node; FALSE if the user is not permitted to update the node.

1 call to _fullcalendar_update_access()
template_preprocess_views_view_node_fullcalendar in ./fullcalendar.module
Prepares variables for template file invoked for node row type.
1 string reference to '_fullcalendar_update_access'
fullcalendar_menu in ./fullcalendar.module
Implements hook_menu().

File

./fullcalendar.module, line 360
Provides a views style plugin for FullCalendar

Code

function _fullcalendar_update_access($node) {
  global $user;
  if (!empty($node) && (user_access('administer nodes') || user_access('update any fullcalendar event') || user_access('edit any ' . $node->type . ' content') || user_access('edit own ' . $node->type . ' content') && $node->uid == $user->uid)) {
    return TRUE;
  }
  return FALSE;
}