You are here

function node_gallery_image_user_access in Node Gallery 6

Same name and namespace in other branches
  1. 6.2 node_gallery.module \node_gallery_image_user_access()
1 call to node_gallery_image_user_access()
node_gallery_operations in ./node_gallery.module

File

./node_gallery.module, line 346
Node gallery module file.

Code

function node_gallery_image_user_access($op, $image = NULL) {
  global $user;
  switch ($op) {
    case 'edit':
      if ($user->uid == $image->uid) {
        return user_access("edit own {$image->type} content") || user_access("edit any {$image->type} content");
      }
      if ($user->uid != $image->uid) {
        return user_access("edit any {$image->type} content");
      }
      break;
  }
}