Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This permission is just weird and confusing. It has nothing to do with administering images. It only allows access to the image gallery admin pages at 'admin/content/image/...'
'administer image galleries' would be much clearer to site admins.
Comment | File | Size | Author |
---|---|---|---|
#10 | image_gallery-409974-2.patch | 2.91 KB | pebosi |
#9 | image_gallery-409974-2.patch | 2.9 KB | pebosi |
#6 | image_gallery-409974-2.patch | 2.91 KB | joachim |
#5 | image_gallery_install-409974.patch | 724 bytes | pebosi |
#3 | image_gallery-409974.patch | 1.86 KB | pebosi |
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 CreditAttribution: 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 CreditAttribution: pebosi commentedrenamed the permission and created a patch.
regards
Comment #4
joachim CreditAttribution: 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 CreditAttribution: pebosi commentedadded install patch.
regards
Comment #6
joachim CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: pebosi commentedupdate joachim's patch to use strtr
regards
Comment #10
pebosi CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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.