You are here

function video_access in Video 6

Same name and namespace in other branches
  1. 5 video.module \video_access()
  2. 6.2 video.module \video_access()

access hook

File

./video.module, line 410
video.module

Code

function video_access($op, $node, $account) {
  if ($op == 'create') {
    return user_access('create video', $account);
  }
  if ($op == 'update' || $op == 'delete') {
    return user_access('edit own video', $account) && $account->uid == $node->uid || user_access('edit all video nodes', $account);
  }
}