You are here

function activity_delete_access in Activity 6.2

Same name and namespace in other branches
  1. 6 activity.module \activity_delete_access()
  2. 7 activity.module \activity_delete_access()

Menu Access callback for delete Activity.

Parameters

int $aid: The activity id for the activity

Return value

boolean Whether or not the currently logged in user can delete the specified Activity.

1 call to activity_delete_access()
activity_handler_field_activity_link_delete::render in views/activity_handler_field_activity_link_delete.inc
1 string reference to 'activity_delete_access'
activity_menu in ./activity.module
Implementation of hook_menu().

File

./activity.module, line 303
Primarily Drupal hooks and global API functions to manipulate activity.

Code

function activity_delete_access($aid) {
  if (user_access('administer activity')) {
    return TRUE;
  }
  if (user_access('delete own activity')) {
    $uid = db_result(db_query("SELECT uid FROM {activity} WHERE aid = %d", $aid));
    return $uid == $GLOBALS['user']->uid;
  }
  return FALSE;
}