'Image galleries' menu item appears without access
Chris Johnson - January 28, 2007 - 23:20
| Project: | Image |
| Version: | 6.x-1.0-alpha4 |
| Component: | image_gallery |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
Description
Even as an anonymous user with no permissions for images in the anon role, the Image gallery link still appears in the Navigation menu. Seems like that link should not be generated for users who do not have access to image galleries at all.

#1
marked http://drupal.org/node/114614 as a duplicate
#2
Still an issue in 6.x.
#3
Looks fine to me:
$items['image'] = array('title' => 'Image galleries',
'access arguments' => array('access content'),
'type' => MENU_SUGGESTED_ITEM,
'page callback' => 'image_gallery_page',
);
We don't supply permissions for viewing galleries, so 'access content' is the best that applies.
@sun: by design?
#4
Closing this as by design:
- this module is essentially a taxonomy module. Core taxonomy doesn't do access permissions so we don't either.
- even if we did add a permission to access the galleries menu item, it would be rather pointless as a user could still go to 'taxonomy/term/$tid' and see listing of the nodes for the gallery, albeit not in quite the same display.
- if you want to restrict access to the gallery listing, Views will allow this: see #405456: Galleries made with views
#5
See http://drupal.org/project/image_gallery_access
#6
Unless you're using an access module, there's no way to restrict access to image galleries. Access to images is controlled by access content, so #3 works correctly.
However, this will change, when #44057: Use core-style content permissions is committed: if a user cannot see images, they shouldn't get the 'Image galleries' menu item, even though they might still be able to see empty taxonomy/term/TID pages. Maybe we shouldn't close this just yet?Image Gallery Access controls both access to galleries as well as to image nodes, but it does not currently remove that menu item for users that can't see any gallery at all. See #543576: Hide the 'Image galleries' menu item for roles that can't see any galleries...
EDIT: Never mind about the effort to implement the core permissions — access content is the only permission that affects viewing.
#7
Image Gallery Access RC1 handles this correctly now, both for 'Views' and 'non-Views' galleries.