if no 'access statistics' permission, don't show stats @ node

Bèr Kessels - December 13, 2005 - 16:49
Project:Drupal
Component:statistics.module
Category:bug report
Priority:normal
Assigned:Bèr Kessels
Status:closed
Description

under each node, we render a number of views or that node. IF a user does not have "access statistics" we should not show this.

Patch fixes that. its a small one-liner.

AttachmentSizeStatusTest resultOperations
stqts_lost_perm_check.diff954 bytesIgnoredNoneNone

#1

rkerr - December 13, 2005 - 16:53

Seems to make sense... :)

#2

jvandyk - December 13, 2005 - 17:42

Yes, this is good. Current behavior is a bug and this patch fixes it.

But I'd rather see a new permission 'access view counts' or some such so that I can turn on view counts without having to give full statistics access to that role.

#3

Bèr Kessels - December 13, 2005 - 19:05

Thinking about it a bit more.
* any $link[] can now be filtered. thus this patch is not at all needed to get the same result: just a theme function that strips out the count 'link' should do.
* any themer can add $count data . so *not* showing this at all by default makes sense too.

I guess its al about what we want as default behaviour.

My vote goes to:
Apply this patch. Then anyone who wants to show anyone the node-view count can do so in a theme function.

But Im perfectly fine if people decide to:
Won't fix this patch and let me+others, who do not want to show this to users, 'hack' it out in a rather simple theme function.

But I am not for a separate permission for this. its not really a permission. And if we go for an option/permission, it should live in the "admin > settings > content-types" and be a per-node option, imnsho.

#4

Bèr Kessels - December 13, 2005 - 19:08

forgot: that last option might be the best. but i'm not coding it :p
Though imho it should just be as simple as a nodapi thing that adds a $node->viewcount. or even $node->viewcount->daily $node->viewcount->alltime. That would be soooo usefull :)

#5

Bèr Kessels - January 10, 2006 - 19:07
Status:needs review» fixed

we now have a permission "view post access counter". this fixes this issue.

#6

raema - January 24, 2006 - 21:47
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.