Closed (fixed)
Project:
Image
Version:
6.x-1.x-dev
Component:
image_gallery
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2009 at 08:41 UTC
Updated:
22 Aug 2009 at 13:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
sunWhy didn't you use the original issue? (#409770: how to create new gallery )
I thought that users would just need to be able to add (or edit/manage) taxonomy terms to create new galleries?
Comment #2
joachim commentedWell the original issue's initial post wasn't really explaining the problem. I thought best to start fresh.
Yes, if you can administer taxonomy, then you can change galleries via the regular taxonomy admin.
But image_gallery adds an admin section just for galleries, which is essentially a duplication of the taxonomy admin.
This allows some labelling changes ('galleries' instead of 'terms') and delegation of gallery management to users without site-wide taxo admin access.
Comment #3
pebosi commentedrenamed the permission and created a patch.
regards
Comment #4
joachim commentedLooks good so far, but I think we need to provide an update function to change that permission for existing sites.
Comment #5
pebosi commentedadded install patch.
regards
Comment #6
joachim commentedRegarding the update function: Drupal core does the string replacing in PHP rather than SQL.
I've no idea if there's a reason for this, but my gut feeling is that we should do what core does -- it's probably due to cross-db compatibility.
Eg, in system.install:
Attaching a combined patch, with the update function changed.
I've tested the updating on a fresh D6.
Comment #7
pebosi commentedYour modified patch works for me, too.
Comment #8
sunInvoking the PCRE engine seems needless. A simple str_replace() or strtr() (latter preferred) is sufficient in the update function.
Comment #9
pebosi commentedupdate joachim's patch to use strtr
regards
Comment #10
pebosi commentedUpdated to use array syntax for strtr.
Comment #11
sunSame as in the other issue for image.module applies here - quickly looking at image_gallery.test uncovers further instances of the permissions. Please ensure all permissions are updated accordingly.
Comment #12
pebosi commentedUpdated the core-style permission patch, which includes the change of gallery permission in test files: http://drupal.org/node/44057#comment-1730082
Comment #13
joachim commentedMaybe I'm reading it wrong, but it doesn't look like http://uk3.php.net/strtr is the right thing to use...
EDIT: yeah I'm reading it wrong. Carry on :D
Comment #14
sunSee also this well-known function: http://api.drupal.org/api/function/t/6 ;)
Comment #15
pebosi commentedPatch #10 still need's review. For changes in test files read #12.
regards
Comment #16
salvis@sun, @joachim: I just saw your discussion on IRC...
You could easily form_alter the image gallery's taxa administration pages to return a 403. However, IMO, 'administer taxonomy' as the more general permission should outweigh 'administer image galleries', so don't do that. I'd say 'administer image galleries' should allow using the image gallery administration pages even if the user does NOT have 'administer taxonomy', so that we can have "gallery administrators," without giving them full access to all vocabularies.
As for
Image Gallery Access takes care of that nicely.
Comment #17
joachim commented@salvis: we were talking about a different issue -- #113629: 'Image galleries' menu item appears without access -- which more or less requests a permission to access /image/tid/$tid. It's this that you can still access at /taxonomy/term/$tid, albeit not formatted the same way.
Though -- interesting module.
I'll point the poster of that other issue to it.
Would you care to add a note about your module to the docs page here: http://drupal.org/handbook/modules/image ?
Comment #18
joachim commentedTested patch on an installation that had the old permission set. Permission was correctly changed for role that had it assigned. No sign of the old perm string in the module code.
All looks good, committing.
#409974 by pebosi: Changed gallery permission from 'administer images' to 'administer image galleries'.
Thank you pebosi for your hard work on this and other patches :D
Sorry it's taken a while to get it committed.