Change permissions for multiple photos at once

sebneu

Joined: 2011-05-15
Posts: 3
Posted: Sun, 2011-05-15 14:22

Hi everyone

I have an album with about 1000 photos, what I want to a achieve is that
guests can see about 30 photos
logged in friends can see about 100 photos
the admin can see all photos

The default setting is that guests can see all photos, now I have to remove for 970 photos the permission for guests. Is there anyway to do this in a batch way?
Or is it possible to remove the permission for all photos for guests in one step and then add the permissions for the 30 fotos?

I am not willing to add separate albums.

Thanks for any thoughts on this
Seb

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2011-05-15 14:35

I wouldn't go about it like that, see this:
http://codex.gallery2.org/Gallery2:ACL_Performance

And that's not the only reason, managing permissions like that will quickly become a nightmare. What happens if you reset permissions on the album and purposely or accidentally change permissions on all sub-items? Then you've got to go back and redo all that work again.

Personally, I'd put what's publicly available in a different album, set permissions on the album and be done with it. Registered users can then see everything else as soon as they log in. But you're not willing to do that, so have fun with your mess. I'm only speaking as someone who has managed permissions across many 1000s of files and 10s of thousands of directories. If you go and start editing permissions of individual files (or photos in this case) and users instead of managing them at the directory (album) and groups then you're in for a whole lot of work.

Have fun.
____________________________________________
Like Gallery? Like the support? Donate now!

 
sebneu

Joined: 2011-05-15
Posts: 3
Posted: Sun, 2011-05-15 15:44

Hi nivekiam

thanks for your reply

I get your point. But since I only want to use 3 groups (everyone, friends, admin) I guess it won't get such a mess. And since it is a private site I don't think it won't get very busy... Third, since my upload is so bad the db performance business won't matter compared to the upload. If I am wrong I could still add a new album and copy the images.

As I get it there is no way to achieve this via the frontend. Is there a way to alter the db directly?

Cheers
Seb

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2011-05-15 15:55
Quote:
But since I only want to use 3 groups (everyone, friends, admin) I guess it won't get such a mess.

Yes, it will, but I'll let you live and learn.

Quote:
Third, since my upload is so bad the db performance business won't matter compared to the upload.

I have no idea what you mean by that. You can use the Replica module to copy items from one album to another.

Quote:
As I get it there is no way to achieve this via the frontend. Is there a way to alter the db directly?

I'll never say no to a question like that, Gallery is editing the DB, so you can too. But it's probably very complex and if you're not doing that through Gallery then it's going to be very easy to make a huge mess of things. If you go this route, make sure you make a backup of everything before you make any changes, every time. :) If you're planning on doing that sort of work, it'll probably be easier to learn G2's code base and create a module to batch edit permissions.

If you have any plans at all to use Gallery 3, none of this will work and to do what you want, you'll need to create separate albums anyway as well as uploading the same image into multiple albums if you want the same image in multiple albums.
____________________________________________
Like Gallery? Like the support? Donate now!

 
sebneu

Joined: 2011-05-15
Posts: 3
Posted: Sun, 2011-05-15 17:51

Hi

thanks again, you convinced me. I'll do it the replica way.

Cheers
Seb