Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | fix-edit-own-petition-688308-2.patch | 1.88 KB | VirtualNorman |
#1 | fix-permissions-688308-1.patch | 2.73 KB | VirtualNorman |
user_access.patch | 912 bytes | theunraveler |
Comments
Comment #1
VirtualNorman CreditAttribution: VirtualNorman commentedThis 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:
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".
Comment #2
VirtualNorman CreditAttribution: VirtualNorman commentedProblem/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.