Closed (fixed)
Project:
Petition Node
Version:
6.x-1.1-beta6
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Jun 2009 at 17:59 UTC
Updated:
17 Jul 2009 at 18:01 UTC
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
Comment #1
gauvain commentedYou 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;
}
Comment #2
tono-bungay commentedThank 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.
Comment #3
gauvain commentedYou 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.
Comment #4
gauvain commentedFixed in the latest release
Comment #5
hbk commentedit's not working.. could you please recheck. thank you.