Download & Extend

Clone access depending on taxonomy or cck

Project:Node clone
Version:6.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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!

Comments

#1

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

#2

Aha... Thanks!

#3

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

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

Status:fixed» closed (fixed)

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

nobody click here