Hello,

I noticed that there was a typo in the user permissions implementation that prevented the "administer petitions" permission from working. I've attached a patch that fixes the problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VirtualNorman’s picture

Version: 6.x-1.4 » 6.x-1.5
FileSize
2.73 KB

This is still an issue in 6.x-1.5.

In 6.x-1.5 permissions are defined as follows:
function petition_perm() {
return array("sign petitions", "create petitions", "edit own petition", "edit petitions", "administer petitions", "administer own petition", "clear petition results", "view signatures");
}

As noted by the original poster, "administer petition" (singular) is used in two spots instead of "administer petitions". As a result, for roles with that permission:

  1. Menu item "Petition List" does not appear as intended at admin/content.
  2. Menu item "Petition Settings" does not appear as intended at admin/settings.

The above patch was filed against 6.x-1.4, but I couldn't get it to apply to that version. I re-rolled the patch against 6.x-1.5.
The above has been fixed in 6.x-2.x.

I also found four locations where the permission "edit own petition" was checked incorrectly as "edit own petitions". The patch corrects these four typos as well. These typos still exist in 6.x-2.x.

Correcting "edit own petition" allows the "Result" and "Clear" menu items to appear on these pages for users with "edit own petition".

  1. admin/content/petition
  2. user/!nodeid/petition
VirtualNorman’s picture

Version: 6.x-1.5 » 6.x-2.x-dev
FileSize
1.88 KB

Problem/Motivation

See #1 for description and how to reproduce.

Proposed resolution

Here is a patch fixing the "edit own petition" typos in 6.x-2.x-dev.