Import Permissions Problem

tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Thu, 2005-01-27 14:54

I imported all of my gallery1 albums into gallery2. Unfortunately, since I was using a content management system, none of the users were imported. So, basically, all albums and pictures are owned by Gallery Administrator. I created a regular user and changed permissions on the album that the user should own. There is only one problem. This change doesn't seem to take effect on any of the underlying subalbums or the pictures. Is there anyway to have this change affect the children albums and pictures? If not, is there any way I can change this information programatically? Where is this information (the owner of the file/album) stored in gallery2?

Thanks!

jason

----

Gallery URL (optional):
Gallery version: Latest nightly v2
Webserver (with version): Apache 2
Datatabase (with version): Mysql
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system:
Web browser/version:

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2005-01-27 18:11

I think that the migration tool will try to match up usernames, so if you manually create users with matching names before trying to import then I think it will line them up for you. Give that a shot.

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Thu, 2005-01-27 18:25

There's no way to do this after-the-fact?

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Fri, 2005-01-28 15:29

Didn't work... migration tool apparently didn't match usernames.

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Fri, 2005-01-28 19:38

G1 does not record uid <-> username matchups from CMSes when it is embedded, so the migration module doesn't have any info to do the username lookups. Until G1 does this I will not be supporting migration of CMS user permissions in the migration module.

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Tue, 2005-02-08 16:35

Is there any possible way (in G2) to do a recursive permission change?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-02-08 17:00

tsorf33, what does this have to do with the migration module? And recursive in respect to what? Album->Subalbum->....->Item recursive or Group->User "recursive"?

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Tue, 2005-02-08 17:27

valiant,

See the ORIGINAL message. I wasn't asking about the migration module. I was asking how to change the permissions recursively for EVERYTHING (subalbums, pictures, videos, etc.). I was wondering if there was someway to do this (that I missed somehow) and if so, how? Else, is something like this planned? A recursive permission change seems to be a necessity IMO.

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Tue, 2005-02-08 17:43

There should be a checkbox on the permissions page to apply the changes to the item and all its children and childrens children. Try it out - I assume that it is completely recursive.

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Tue, 2005-02-08 17:51

I used that checkbox (I believe it appears below the username textbox) on the last build I had downloaded, but it did not change the permissions recursively. I will take a look at the latest nightly build and see if it is working in that version.

Thanks!

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Tue, 2005-02-08 18:16

tsorf33, wouldn't it be better if you could change the owner of the sub-albums? If you want all albums to be owned by this new user that you created - it's just single statement. If you have several album trees that should be owned by different users - it's a litle more complex, but quite doab;e nevertheless.

Changing permissions recursively should work, no questions about it - but is it what you really want?

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Tue, 2005-02-08 18:31

Perhaps I didn't state my problem well enough. :oops: What I'm actually trying to do is to change the OWNER of an album (AND all of the sub-albums and pictures contained within). When I go to the 'Edit Permissions' page, I can see where I can change the Owner (it appears above the checkbox for recursiveness -- which leads me to believe that perhaps ownership is INTENDED to not be recursive?). When I change the owner, it does not change the ownership of the sub-albums and pictures beneath the album. I have just confirmed this with the latest version of G2. Sorry if I wasn't being clear in my terminology earlier.

My problem is this -- I have several Gallery 1 users. Each of them is given ONE album. They, in turn, create sub-albums under this album (and pictures under those sub-albums). Since I'm using an embedded Gallery 1, the users are not migrated from Gallery1 to Gallery 2. Therefore, all albums and pictures are owned by 'Gallery Administrator'. What I would like to do is to import all of the current pictures from Gallery1, have the users create new Gallery2 accounts, then recursively change the ownership of the album which they should own. I suppose I could just give them PERMISSION to do whatever to the albums and sub-albums easily (assuming permissions work recursively -- which I believe they probably do). But, I'd rather change the ownership, so that they actually own all of the pictures, etc. If there's not a good way to do that, I'll give up and just try the permission route.

Thanks again all!

 
virshu
virshu's picture

Joined: 2003-09-13
Posts: 314
Posted: Tue, 2005-02-08 19:24

that's exactly what I thought you wanted to do - changing the owner. Then I got confused with subsequent posts... so no need to apologize! How familiar are you with SQL? You can set the owners for "top" albums (I presume they are all just under root level). Assuming you are using MySQL, I can put together couple statements that will do the job. (of course, with usual legalese disclaimers - take a backup, I am not responsible, I am just a big-eared creature that you can't find anyway, blah blah blah) :wink:

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Thu, 2005-02-10 12:58

Strangely enough, I tried that. That's actually why I posted to the list. I suppose I didn't know the schema well enough. But, in the g2_item table, I ended up changing the g_ownerId to the id of the new owner. But, nothing changed in the webpage. I was frustrated by this and just decided to post to the list. Oh well! :)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-02-10 15:46

you must click FlushCache on lib/tools/test/index.php after changing anything directly in the database..

 
tsorf33

Joined: 2003-10-31
Posts: 20
Posted: Fri, 2005-02-11 19:00

Eh? How do I do that? I thought there might be some caching issues, but I figured restarting Apache might cause the cache to flush. Guess not. Can you let me know how to do that? I'd greatly appreciate it!

EDIT: Oh, do I just surf to that link in G2? I'll try that. No need to repond if that is the case.

Thanks!

 
MyWebsiteAdviser

Joined: 2007-04-12
Posts: 46
Posted: Tue, 2007-07-31 13:01

Hi,

There is detailed Gallery permission article, include how to set up Gallery permission video.

Enjoy,
Create Web Album.