Closed (fixed)
Project:
Module Grants
Version:
6.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Sep 2009 at 03:12 UTC
Updated:
24 Nov 2009 at 02:40 UTC
Hi Rik,
Maybe this was done on purpose for simplicity, but it seems like a bug to require one specific permission out of a collection of equal permissions as the test for whether the feature is active at all. Deselecting that one tab shuts down the entire show. I discovered this because it is superfluous in my setup, given that I can predict how my authors will be using the site. Probably better to OR the whole lot and see if any are set for that role.
Thanks,
Ron.
Comments
Comment #1
rdeboerThanks Ron,
Yes there may be some room for improvement there...
... or install at least the Smart tabs part of Smart menus, Smart tabs.
This will make the double row of local tasks (tabs) behave in a more natural way, as well as any other tabs on your site.
Rik
Comment #2
rhouse commentedHi Rik,
AFAIK the tabs work fine, I love your new work, it's the navigation menu entry that disappears. (Maybe the tabs don't work either, but I can't tell because there is no menu entry for getting there. :-) )
Ron.
Comment #3
guillaumeduveauConfirming, /accessible-content disappears in the navigation menu whenthe user has not for permission to access to "I last modified' tab"
Comment #4
not_Dries_Buytaert commentedThe 'Accessible content' link disappears, ONLY when the "access 'I last modified' tab" AND/OR (!) "access 'Published' tab" permissions are disabled.
The cause for this is the following:
The link of the 'Accessible content' navigation menu item points to:
http://{domain}/accessible-content
However, this path/location is also used for displaying the published and (!) last modified nodes of the authorized user.
Fortunately, all the overviews this modules creates remain accessible to authorized users:
1) The solution could be to
1a) display a page with only aforementioned 12 links here:
http://{domain}/accessible-content
1b) AND change the path/location of the 'I last modified' tab from:
http://{domain}/accessible-content
to:
http://{domain}/accessible-content/i-last-modified
2) For clarity/ consistency, I suggest also changing the links of the "Published" sub-tabs
from:
http://{domain}/accessible-content/{i-'operation'}
to:
http://{domain}/accessible-content/{i-'operation'}/published
Please, can anyone confirm this and change to code to implement both suggestions?
Comment #5
rdeboerFrom the Module Grants project page, section Latest Features and the documentation page for Module Grants:
Let me explain why this is (and I'm kind of hoping that I'm wrong, i.e. I'm hoping there's a more flexible solution).
First of all, the URL structure needs to be layered the way it is, as this is Drupal's way of recognising the menu structure and the fact that the associated page has two rows of tabs (aka "local tasks") on it.
Second, Drupal core dictates that every row of tabs must have a DEFAULT tab. This default is static in that it is set when the module that creates the tabs (i.e. Module Grants) is enabled. Furhtermore the default tab is the same for every user regardless of any permissions the user may have or not have.
In Module Grants the default for the first row of tabs is set to the "I Last Modified" tab and the default for the second row of tabs is the "Published" tab. It is this selection that will be active initially when you click the "Accessible content" menu item.
However the user permissions are evaluated on the fly every time a user visits a page. Therefore, if the user doesn't have both the 'access I Last Modified tab' and 'access Published tab' permissions the menu option is suppressed (standard Drupal behaviour) or if you force the full URL an authorisation error occurs, because the default tab selection has not been permitted for the user in question.
The friction between static default tabs and the dynamically evaluated user permissions is an intrinsic quirk of the Drupal menu system. If anyone has a simple and effective workaround I would be most interested.
In the meantime I recommend using Smart tabs, which alleviates (although not quite fixes) this issue. I have almost completed the integration between Module Grants and Smart tabs, so this should soon be an issue of the past.
Smart tabs also gives you a handy memory function (for all tabs in Drupal), which makes the double row of tabs behave much more naturally. Smart tabs comes bundled with Smart menus, as they play nicely together, however you don't have to install one to use the other.
Comment #6
rdeboerFixed in versions dated 11-Nov or later.
Note that Module Grants now requires Smart tabs.
If you don't like the memory function that Smart tabs brings to your pages, but would still like your tabs on Module Grants' Accessible content page to work properly without any permission issues, then simply go to Aminister >> Site configuration >> Smart tabs and blank out the Pages to include text box on the page.
If you want the Smart tabs memory function for the Accessible content page only, then enter in the Pages to include text box the following 2 lines:
If you're happy to have the memory function on all your pages enter * in the text box.
See the project page and documentation for details.