Answering to "Allow Recent posts only for certain roles?" (http://drupal.org/node/199152) I've found, that there is no hook_perm in tracker.module (Drupal 5.3&5.5).
It cause missing "tracker access" row under Access control page (admin/user/access).
After deep googling, old patch was found, tested and seems to work.
I've insert
/* Implementation of hook_perm() */
function tracker_perm() {
return array('access recent posts');
}
before
/**
* Implementation of hook_menu().
*
and replace
'callback' => 'tracker_page', 'access' => user_access('access content'),
to
'callback' => 'tracker_page', 'access' => (user_access('access content') && user_access('access recent posts')),
It works for me, but for sure it need to be tested before patched and committed. Somebody?
P.S. I've attach tracker.module file with code, mentioned above.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | tracker-perm-d7.patch | 1.46 KB | lilou |
| #3 | tracker-perm.patch | 1.52 KB | davemybes |
| tracker.module.txt | 5.63 KB | yurg |
Comments
Comment #1
johanneshahn commentedalso replaced line 48:
'callback' => 'tracker_track_user', 'access' => user_access('access content'),to:
'callback' => 'tracker_track_user', 'access' => (user_access('access content') && user_access('access recent posts')),look at if($may_cache) else ->
Comment #2
summit commentedHi,
The hook is not working for me.
The /tracker page is still available for anonymous users while I set the access control to only be accessable to admin.
EDIT: This post maked me happy: http://drupal.org/node/199152#comment-654288
It appears there is also a view tracker. That should also be disabled.
It is working now, thanks for the hook!
Greetings,
Martijn
Comment #3
davemybes commentedGreat fix for a really annoying bug! Thanks. FYI, it also works for 5.7 - patch is attached.
Note, if you have Views enabled, but not tracker, simply disable the "recent posts" View.
Comment #4
drummThis new permission would remove access to the tracker when upgrading 5.x until an admin sets the new permission. This is not something that should happen during a routine bugfix upgrade.
It would be best to start with the current development version.
Comment #5
lilou commentedReroll.
Comment #6
lilou commentedCNW since hook_perm update.
Comment #7
aspilicious commentedNever heard of tracker module ;)