'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
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

drewish - February 26, 2007 - 07:09

marked http://drupal.org/node/114614 as a duplicate

#2

sun - January 16, 2009 - 02:00
Title:Image gallery link appears in Navigation block without authorization» 'Image galleries' menu item appears without access
Version:5.x-1.x-dev» 6.x-1.0-alpha4

Still an issue in 6.x.

#3

joachim - March 21, 2009 - 18:22

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

joachim - August 8, 2009 - 08:00
Status:active» by design

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

joachim - August 8, 2009 - 10:46

#6

salvis - August 8, 2009 - 13:20

Seems like [the 'Image galleries' Navigation menu item] should not be generated for users who do not have access to image galleries at all.

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

salvis - November 22, 2009 - 19:21

Image Gallery Access RC1 handles this correctly now, both for 'Views' and 'non-Views' galleries.

 
 

Drupal is a registered trademark of Dries Buytaert.