Assume a (contributed) D7 module, say module ABC, comes with only a few permissions (which can be set on the typical
/admin/people/permissions page). For example:
- Administer module ABC.
- Access (view) "all results" produced by module ABC.
Whereas "all results" can be found within a site via a combination of URLs (with corresponding menu items also) like:
- ABC/SomethingX (X=1, 2, ...).
- ABC/SomethingElseY (Y=1, 2, ...).
Which site building techniques can be used (without hacking the module), to grant access to such URLs as in this example:
- Access to
ABC/SomethingXis allowed for anybody.
ABC/SomethingElseYis only allowed for authenticated users.
node/*/ABCis only allowed for authenticated users.
- For any URL that is only allowed for authenticated users, its corresponding menu item should be visible to anonymous also. This to show such users that such menu item is available, but with some type of Drupal message to inform them that login is required to actually use such link.
Real world situations (use cases):
- The question about "content access + menu block => not shown all links in menu block": by using the Content Access module access to selected nodes is restricted (of course). But how can menu items corresponding to such selected nodes remain visible for anonymous users anyway?
The Visitors module: replace 'ABC' by 'visitors' in the example above, and assume that you want to grant access to "some" reports (=
ABC/SomethingX) for anybody, but not to "some other" reports (=
Access (view) "all results" produced by module ABCwould be set to "authenticated", then anonymous users cannot see any URL. While if that permission would be set to "anybody" (= either "anonymous" or "authenticated"), then anonymous users also have access to (eg)
ABC/SomethingElseY(which is not what is desired).
How can menu items corresponding to
ABC/SomethingElseY remain visible for anonymous users anyway?