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.

CommentFileSizeAuthor
delete_permissions.patch1.17 KBgdd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miro_dietiker’s picture

I 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.

Dries Arnolds’s picture

I just wanted to request this change.

Miro, any luck testing and committing this patch? Should I still test it?

miro_dietiker’s picture

Reviews please!
I'm always open for RTBC patches, but please take your time.

diego.pasc’s picture

there 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');

gobinathm’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

D6 is EOL hence this issue won't be fixed (or) attended. So closing it.