The access counter permission is not used.

There is a permission set called: access counter
With this NOT set, the following can be accessed:
- the counter block
But, the following cannot be accessed:
- the counter report
- the counter admin facilities

With this set, the following can be accessed:
- the counter block
But, the following cannot be accessed:
- the counter report
- the counter admin facilities

So, what on earth is the access counter for?

I searched the code and found that access counter is only used in the counter_perm hook, and never anywhere else.

I would like the access counter permission to give access to the counter report, though a separate permission called access report is probably better suited for that.

Patch instructions to use access counter permission to provide access to the report instead:
File: counter.module
26(o): return array('access counter', 'administer counter');
26(n): return array('access counter report', 'administer counter');

84(o): 'access arguments' => array('administer counter'),
84(n): 'access arguments' => array('access counter report'),

Comments

alberto56’s picture

Right, the block should not be accessible if one doesn't have access counter permission.

drupalnesia’s picture

Status: Active » Closed (fixed)

6.x-2.9: Bug fix: Change 'administer whizzywig' to 'administer counter'
Bug fix: Replace 'counter_show_administer_only' to 'hide counter' in Permissions

To avoid misunderstanding then we use "Hide Counter" in Permissions page. This option also replace 'counter_show_administer_only' variable.

Mean, to hide Counter for selected role then just tick "Hide counter" check-box in User Management-Permissions.

alberto56’s picture

Title: Permission set does not make sense » Permissions should add functionality not remove it: "Hide counter" removes functionality
Version: 6.x-2.4 » 6.x-2.9
Category: bug » feature
Status: Closed (fixed) » Active

I'm setting this to active because, as I see it, Drupal permissions should always add functionality and not remove it. Using the Hide counter permission causes some confusion. For example:

  • user 1 always has all permissions by default -- one would expect user 1 to have the "hide counter" permission, but it doesn't
  • the adminrole module (usage stats: over 10,000) creates an administrator role which always has all permissions. It is counter-intuitive that a user with this role would have the "hide counter" permission and that it would be impossible to remove (as is the case)

I would strongly suggest using "view counter" and not "hide counter".

Anonymous’s picture

Has any progress been made to revert the 'hide' to 'view'? Or does one need to downgrade to a previous version?

Due to Drupal's cumulative permissions the only options now are for anon and authenticated to not see it and by checking authenticated, then all roles above can not see the counter either.

This module was being used on our site to show only the higher level users the counter block. Now even they can't see it.

drupalnesia’s picture

Status: Active » Fixed

@alberto56: you right
@Quartz: please try Counter 6.x-2.10

6.x-2.10: Bug fix: replace 'hide counter' to 'view counter' for compability with admin role module

drupalnesia’s picture

6.x-2.11:
--------
Bug fix: if (!user_access('view counter') to if (!user_access('view counter'))
Bug fix: PostgreSQL INSERT INTO WHERE NOT EXISTS with right PostgreSQL syntax

Anonymous’s picture

drupal-id.com

Thank you very much. I appreciate such a prompt reply and fix.

Have installed 6.11 and it's all back to working the way it was :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.