Auth User with full access to Node-Module and Node-Gallery gets Access denied when trying to add or edit pictures.
Adding, Editing and Modifying Albums ist working fine though.

>> Node Gallery Access is disabled and I'm not willing to use it.

Maybe I'm missing some access rights but I don't know what

Comments

tripsmarter.com’s picture

I have the same issue, Drupal 6.6. Node Gallery Access has been on and off, same result.

Edit: I actually turned on all permissions for auth users, rebuilt and tried to upload an image. Still didn't work.

cgraefe’s picture

I experienced the same issue on Drupal 6.6. It looks like the function node_gallery_user_access() is quite broken. In its current form, it tries to use a non existing property "gallery_config" from a gallery object that does not exist either. The code below seems to fix the problem. I'm not sure if it is entirely correct, though. To me, it still looks like it won't distinguish between "edit own" and "edit any" privileges. But then again, I'm still new to Drupal...

function node_gallery_user_access($op, $a2 = NULL) {
  switch ($op) {
    case 'view':
      return user_access(NODE_GALLERY_PERM_VIEW_GALLERY);
      break;
    case 'upload':
      $gallery = $a2;
      $image_type = $gallery->getConfig()->image_type;
      return user_access('create '. $image_type .' content');
    case 'edit':
      $gallery = $a2;
      $image_type = $gallery->getConfig()->image_type;
      return user_access('edit own '. $image_type .' content') || user_access('edit any '. $image_type .' content');
      break;
  }
}
wilson98’s picture

thanks, this is a bug, check the alpha2 release, it should be fixed.

kmonty’s picture

Status: Active » Fixed

Appears fixed to me too

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.