Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
This patch adds to hook_perm() and hook_access() to allow users to either delete all polls or delete their own polls. Gave it a quick run through the pertinent possibilities and seems to be working fine, but would like another set of eyes on it since it is an access control issue.
Comment | File | Size | Author |
---|---|---|---|
delete_permissions.patch | 1.17 KB | gdd | |
Comments
Comment #1
miro_dietikerI see this really makes sense and looks fine.
I'm a little confused why advpoll runs on custom permissions and doesn't reuse the regular content type permission pattern (create, edit own|any, delete own|any). We should look at webform which perfectly does that.
also am i right that currently there's no way to allow binary votes only to be created for a certain role?
If we would limit permissions by regular pattern per content type that would work fine.
Comment #2
Dries ArnoldsI just wanted to request this change.
Miro, any luck testing and committing this patch? Should I still test it?
Comment #3
miro_dietikerReviews please!
I'm always open for RTBC patches, but please take your time.
Comment #4
diego.pasc CreditAttribution: diego.pasc commentedthere is a small mistake in the patch: in my version of Advanced Poll (6.x-1.x-dev) it's supposed to be also a permission called 'show vote results'.
But this permission does not appear in the patch at all!
Whithout this permission there is no way to see the result of the poll.
So if you edit the patch (adding this permission by hand)... then the patch works.
These are the only 2 rows I edited in the patch:
- return array('create polls', 'edit polls', 'edit own polls', 'vote on polls', 'cancel own vote', 'administer polls', 'inspect all votes', 'show vote results', 'access electoral list', 'add write-ins');
+ return array('create polls', 'edit polls', 'edit own polls', 'vote on polls', 'cancel own vote', 'administer polls', 'inspect all votes', 'show vote results', 'access electoral list', 'add write-ins', 'delete polls', 'delete own polls');
Comment #5
gobinathmD6 is EOL hence this issue won't be fixed (or) attended. So closing it.