Hi there, I was wondering if it was possible to have the node gallery's "Upload images" link display for authenticated users? What I'm doing is creating the albums as an administrator, and then have authenticated users upload their images to those albums (of their choice) for other authenticated users to view.

I've been trying to work with the permissions but haven't been successful at it. The only links that would show to the authenticated user are Edit Gallery and Delete Gallery.

I've tried searching for an answer throughout the drupal site and there was only one posting similar to this (November 2008), but it didn't have a solution or steps.

Any thoughts anyone? Would this be something that would have to be modified in the module's code? I'm currently learning php as i go along, but any help would be appreciated.

Comments

kmonty’s picture

Component: User interface » Code
Category: support » feature

Yes, this is a permissions limitation with the module. If you cannot edit the gallery, you cannot upload images.

From node_gallery_user_access in node_gallery.module

case 'upload':
      if ($user->uid == $gallery->uid || $user->uid == 1) {
        return user_access('create '. $gallery_config->image_type .' content');
      }
      break;

If you would like to contribute code to make this happen, it would be great!

Bensbury’s picture

This is just a snippet but might help people like me who don't know how to write drupal modules:

If you would like to give upload access to authenticated users.........take the code form the above post

case 'upload':
      if ($user->uid == $gallery->uid || $user->uid == 1) {
        return user_access('create '. $gallery_config->image_type .' content');
      }
      break;

change it to:

case 'upload':
      if ($user->status != 0 || $user->uid == 1) {
        return user_access('create '. $gallery_config->image_type .' content');
      }
      break;

This looks like it will mess up access for just your own content, but it does allow all your authenticated users to be able to upload.

Maybe I can have a go at doing this properly?

kmonty’s picture

Status: Active » Closed (fixed)

Closing out all 6.x-1.x feature requests.

Similar requests have been made against the 2.x branch already.