Clearly the code is there to delete selected signatures, but I haven't figured out how to make signature administration appear. What am I missing?

Comments

gauvain’s picture

You find the signature administration in the node's tab menu (besides View, Edit, Signatures etc):
node/%petition_menu/signatures-admin

In the hook_menu:

//Administer the signatures
$items['node/%petition_menu/signatures-admin']=array(
'title' => 'Administer Signatures',
'page callback' => 'petition_signatures_admin_page',
'page arguments' => array(1),
'access callback' => 'petition_maintainer_access',
'access arguments' => array(1),
'file' => 'petition-signatures-admin.inc',
'weight' => 3,
'type' => MENU_LOCAL_TASK
);

You should check you have access:

The petition_maintainer access function is:

function petition_signature_access($node) {
Global $user;
if ($node->display_mode == '0none') {
$access = user_access('edit own petition', $user) && ($user->uid == $node->uid);
} else {
$access = node_access('view',$node, $user);
}

return $access;
}

tono-bungay’s picture

Version: 6.x-1.1-beta5 » 6.x-1.1-beta6

Thank you. I wanted other admins, not just the user who created the petition, to be able to delete signatures and download results. Tweaking the access function did the trick.

The reason was to delete duplicate signatures and signatures that don't respect the geographic settings, which were imported by someone who had edit access but not maintainer access.

gauvain’s picture

You are right, there is a miss in the code: people with access "administer petition" should be able to administer the signatures and download the results of all petitions.

I am not able to change the code in cvs at the moment. It will be fixed next week. Meanwhile, you can change the petition_maintainer_access function as follows:

function petition_maintainer_access($node) {
Global $user;

if (is_numeric($node->tnid) AND $node->tnid>0 AND $node->nid!= $node->tnid) {
$access = FALSE;
} else {
$access = (user_access('edit own petition', $user) && ($user->uid == $node->uid)) || user_access('administer petition', $user);
}

return $access;
}

The users you have given the 'administer petition' access will be able to administer the signatures of all the petitions on your site.
Please try to do the change and confirm you get what you want before I change it in the cvs.

gauvain’s picture

Status: Active » Closed (fixed)

Fixed in the latest release

hbk’s picture

it's not working.. could you please recheck. thank you.