add new sub-task link must be hidden to unauthorized roles
erdemkose - April 15, 2006 - 15:10
| Project: | Tasklist |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Description
"add new sub-task" link is shown to everyone including anonymous visitors. This link should be visible to roles who have "create task" permission.
Here is a rewrite of tasks_link function: simply added && user_access('create task') to the if statement.
<?php
function tasks_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type == 'node' && $node->type == 'tasks' && user_access('create task')) {
if (!$teaser) {
$links[] = l(t('add new sub-task'), "node/add/tasks",
array('title' => t('Add a new task to this task list')), "edit[parent]=$node->nid");
}
}
return $links;
}
?>
#1
here is a patch for it.
#2
Fixed in CVS.
#3