Problem/Motivation
There is no way of distinguish access permission of the tracker modules track tab. Currently the "access content" permission is used to access the track tab on the user page. The intention is to refine this.
Proposed resolution
The patch in #45 adds these three permissions:
- access global tracker
- access other user's tracker
- access own tracker
Remaining tasks
The given patch has to be reviewed and tested by some more people to be able to be set RTBC.
User interface changes
Added permission on the administer permission page.
API changes
No changes.
Original report by gaellafond
Hi,
It seem that the tracker module in Drupal 6.16 core do not have any permissions handler. It only check if the user has access content or not. This patch add a access tracker and a access own tracker setting in the permission page.
In other words, this patch allow you to nicely disable the track tab.
NOTE: I added a special case denied access to user own tracker if the user has access to tracker but not to his own tracker. It seem odd to me to allow a user to see all other user's tracker but not his own, but I guess that's what you expect if u check the access tracker but not access own tracker.
| Comment | File | Size | Author |
|---|---|---|---|
| #45 | tracker-permissions-762962-45.patch | 14.1 KB | avpaderno |
| #43 | tracker-permissions-762962-43.patch | 12.3 KB | avpaderno |
| #39 | tracker-permissions-762962-39.patch | 11.67 KB | avpaderno |
| #37 | tracker-permissions-762962-37.patch | 10.97 KB | avpaderno |
| #35 | tracker-permissions-762962-35.patch | 10.96 KB | avpaderno |
Comments
Comment #1
gaellafond commentedThanks to Bluetegu for the idea.
If you are using Drupal 5, you should use his patch: http://drupal.org/node/510802
Comment #2
gaellafond commentedFor some reason, the patch has been uploaded successfully on my first post, but it's not visible...
For those who are new with drupal, the permissions page can be access from the admin menu:
Administer > User management > Permissions
Comment #3
Z2222 commentedThanks, the patch worked for me.
I would call this an important issue. Users on some kinds of sites will consider it creepy to have a link called "track" on their user profile, but completely disabling the tracker module removes other functionality.
Comment #4
jumoke commentedgaellafond!! This patch helped me. Thanks :)
Comment #5
locomo commentedsusbscribe
Comment #6
fehin commentedsubscribing
Comment #7
bryancasler commentedLets get this committed, I'm not sure why this issue wasn't addressed sooner.
Comment #8
Anonymous (not verified) commentedI am not sure such changes are still made for Drupal 6; probably the patch should be made for Drupal 7, and then back ported to Drupal 6.
Comment #9
avolve commentedthis patch fails (for Drupal 6.19)
Comment #10
gaellafond commentedThe module has probably been update since I created the patch. I will revise it latter.
Comment #11
Drake commentedDid you find a solution?
Or is it other solution to disable the tracker tab in user profile?
Comment #12
izmeez commentedsubscribing
Comment #13
gaellafond commented@Drake No, unfortunately, as far as I know, there is no other solution. That's why I made this patch.
@avolve If you fail to apply the patch, maybe you can have a look at it to see why it's not working. It's a very simple patch that add a few lines of code to the file
tracker.module. I will try to invest some time on it this week-end, but I can't promise anything. Btw, what is your Drupal's version? I suppose it can't be apply on D7 since it's implementation is quite different.Comment #14
gaellafond commented@avolve I test the patch and it's working. Maybe it is not working as you expect.
1. I install a fresh install of the last version of Drupal 6 (version 6.19).
2. I set the permission to allow everyone to see user profiles and allow the authenticate user to create content.
3. I activated the tracker module.
4. I create a simple user and I insert 2 contents.
5. I log out and I was able to see the tracker with the anonymous user.
6. I download the patch in the module folder of the drupal installation (not the tracker module folder).
7. I apply the patch by running the command
patch -p0 < D6-tracker-permission_0.patch. The patch apply flawlessly.8. I went to the permission and I activate the permission to allow user to see there own tracker.
9. I log out and now anonymous users can not see the tracker.
I look at some other patches and the need to be copied in the module folder. I'm not sure if this is correct or not. Personally, I thing it's more obvious to copy it to the tracker module folder. If you want, I can modify the patch file to allow it to apply directly from the tracker module folder.
Btw, what command did you use to apply the patch?
I hope that's help.
Comment #15
jdelgama commentedFollow step by step your instructions, patch applied ok, permissions assigned only to one role but annonymous users still see the "track" tab on pages :-(
Any ideas? Maybe my Drupal/PHP version? Any configuration I've left?
Working on Drupal 6.19 + MySQL 5.0.77 + PHP 5.1.6
Comment #16
gaellafond commented@jdelgama Our anonymous users are not allow to see the users' profile. I didn't know it would cause an issue. I will correct that as soon as I can.
Thanks for your feedback.
Comment #17
arsunyiu commentedsubscribing
Comment #18
mdupontFeature request have to go against D8 then backported to other versions.
Comment #19
izmeez commentedI second the thought in comment #3 that the name "tracker" can be unnerving for users and those new to Drupal so I wonder if it would be worthwhile to start a new issue feature request to rename to "activity" or something else more benign?
Comment #20
bryancasler commentedizmeez: I had the same thought, if you start that new issue que post a link here so we can follow along.
Comment #21
izmeez commentedI have opened a separate issue on the naming question, Change "Track page visits" to "Page visits"
Comment #22
avpadernoThis is the patch for Drupal 8.
Comment #23
avpadernoComment #26
avpadernoComment #28
praddles commented#26: tracker-permissions-762962-26.patch queued for re-testing.
Comment #30
avpadernoI re-wrote the patch, as the path for the module files changed, since one of the last commits.
Comment #31
yoroy commentedTagging, I see multiple 'add permissions for foo' issues going on.
Comment #32
joachim commentedThere are two permissions, but there are really three types of tracker:
- global tracker
- user tracker
- own tracker
What combination of permissions would allow user X to see the global tracker and see their tracker but not user Y's?
Comment #33
avpadernoI can think of two solutions:
Comment #34
joachim commentedI'd say 'access global tracker' / 'access user trackers' / 'access own user tracker' so it has the same pattern as other permissions that have a special case for 'own'.
Comment #35
avpadernoComment #37
avpadernoOK, now I can try with the real thing. :-)
Comment #39
avpadernoThis patch should fix all the failing tests.
Comment #40
maxheight2 commentedIs there a patch for D7?
Comment #41
avpaderno#39: tracker-permissions-762962-39.patch queued for re-testing.
Comment #43
avpadernoI have updated the patch.
Comment #45
avpadernoComment #46
aboros commentedfrom what i see the patch in #45 works properly. i can see the introduced permissions and they also work/apply as expected.
Comment #47
BrockBoland commentedNeeds issue summary
Comment #48
McGo commentedissue summary added.
Comment #49
McGo commentedPut the tag back again to hope that magic happens regarding http://core.drupalofficehours.org/task/733
Comment #50
BrockBoland commentedFor future reference: no, changing the tags here doesn't affect the tool at doh.org
Comment #51
xpresto commentedThis patch does not work for me (see dump below). The reason might be my Drupal version - 6.28?
Is there any way to include the fix into next Drupal 6 version?
patch -p0 < tracker-permissions-762962-45.patch
patching file b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED -- saving rejects to file b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php.rej
patching file b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerNodeAccessTest.php
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerNodeAccessTest.php.rej
patching file b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
Hunk #1 FAILED at 21.
Hunk #2 FAILED at 48.
Hunk #3 FAILED at 60.
Hunk #4 FAILED at 86.
Hunk #5 FAILED at 114.
Hunk #6 FAILED at 132.
Hunk #7 FAILED at 147.
Hunk #8 FAILED at 160.
Hunk #9 FAILED at 175.
Hunk #10 FAILED at 190.
Hunk #11 FAILED at 199.
Hunk #12 FAILED at 213.
Hunk #13 FAILED at 230.
Hunk #14 FAILED at 256.
14 out of 14 hunks FAILED -- saving rejects to file b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php.rej
patching file b/core/modules/tracker/tracker.module
Hunk #1 FAILED at 29.
Hunk #2 FAILED at 155.
2 out of 2 hunks FAILED -- saving rejects to file b/core/modules/tracker/tracker.module.rej
Comment #52
avpadernoYou cannot apply a patch for Drupal 8 to Drupal 6.
Comment #53
avpaderno#45: tracker-permissions-762962-45.patch queued for re-testing.
Comment #55
xpresto commentedI'm confused.
Post #14 in this thread:
http://drupal.org/node/762962#comment-3660368
says:
"I install a fresh install of the last version of Drupal 6 (version 6.19)..."
- and I was under impression that the patch is for Drupal 6 and post #15 further confirms this.
Assuming that I misunderstood this - I'm still not sure if the issue is considered as bug and will be fixed in Drupal 6? This is definitely a bug, and this is a security bug. Are you saying that it will not be fixed in Drupal 6? Anybody has repro for Drupal 7?
If the problem is identified and understood, you made actual code fixing it (hm, for Drupal 8 as you say), why not push the fix to Drupal 6 and 7? Can somebody from dev team explain this please?
Thanks for your time.
Comment #56
avpadernoSee comment #18: Since that comment, the issue report is for Drupal 8. The patch could be then ported to Drupal 7, but it will not ported to Drupal 6 since there isn't any security issue. On Drupal 6, tracker pages are accessible from who has the permission to access content, not from every user.
Comment #57
neRok commentedMarked #1432910: User profile track tab permission needs adding as duplicate.
Comment #58
gynekolog commented#45: tracker-permissions-762962-45.patch queued for re-testing.
Comment #60
kpm commentedsubscribing
Comment #60.0
kpm commentedadd issue summary.
Comment #61
kopeboyWhat about Drupal 7??
Comment #62
ecvandenberg commentedThis issue is still valid for Drupal 7.41
With the core tracker module enabled, all users with the permission to see user profiles also see other user's tracker data. Even without the permission to access statistics.
The only solution is to disable the tracker module.
Comment #75
quietone commentedThis extension is deprecated and scheduled for removal in Drupal 11.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
It will be moved to the contributed extension once the Drupal 11 branch is open.
Comment #77
andypostComment #78
batigolixThis is a duplicate of #2978468: Activity Tracker module does not allow to prevent anonymous users from seeing the users activity.