Clone access depending on taxonomy or cck

Amir Simantov - April 8, 2009 - 22:16
Project:Node clone
Version:6.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi! I have installed today this module and it helps me so much! I am using it for cloning webforms :-)

I need some help with adding access filtering. i actually opened a node for that in the support forum, but though then that it may be wise to give a link to it here.

Could anybody help me with this? The link: http://drupal.org/node/428308

Thanks a lot!

#1

pwolanin - April 18, 2009 - 02:55

You have to write your own little module to respond to this hook.

#2

Amir Simantov - April 20, 2009 - 17:58

Aha... Thanks!

#3

pwolanin - April 20, 2009 - 19:38
Status:active» fixed

Here's a trivial example I rolled - if you already have a custom module for site tweaks add the implementation there.

template_node.info

; $Id$
name = Clone template nodes
description = "Allows users to clone only nodes whose title starts with the word Template."
core = 6.x

template_node.module

<?php
// $Id$

/**
* Implementation of hook_clone_access_alter().
*/
function template_node_clone_access_alter(&$access, $node) {
 
$access = $access && (stripos(trim($node->title), t('Template')) === 0);
}
?>

#4

Amir Simantov - April 21, 2009 - 10:22

Thanks again. Do you know how do I have to code it in such a way that it will based on taxonomy, and not the title of the node?

#5

System Message - May 5, 2009 - 10:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.