Commit af9a3068 authored by jonnybradley's avatar jonnybradley

[bp/r59259][bp/r59258][FIX] trackers: Allow tracker admins to make user items...

[bp/r59259][bp/r59258][FIX] trackers: Allow tracker admins to make user items for other users, recent unknown regression, how did this ever work?
parent 14155de2
......@@ -734,7 +734,16 @@ class Services_Tracker_Controller
// test if one item per user
if ($definition->getConfiguration('oneUserItem', 'n') == 'y') {
$tmp = TikiLib::lib('trk')->get_user_item($trackerId, $definition->getInformation());
$perms = Perms::get('tracker', $trackerId);
if ($perms->admin_trackers) { // tracker admins can make items for other users
$field = $definition->getField($definition->getUserField());
$theUser = isset($fields[$field['permName']]) ? $fields[$field['permName']] : null; // setup error?
} else {
$theUser = null;
$tmp = TikiLib::lib('trk')->get_user_item($trackerId, $definition->getInformation(), $theUser);
if ($tmp > 0) {
throw new Services_Exception(tr('Item could not be created.'), 400);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment