import('ttTimesheetHelper');
 
 // Access checks.
-if (!(ttAccessAllowed('manage_own_timesheets') || ttAccessAllowed('manage_timesheets'))) {
+if (!(ttAccessAllowed('manage_own_timesheets') || ttAccessAllowed('manage_timesheets') || ttAccessAllowed('manage_all_timesheets'))) {
   header('Location: access_denied.php');
   exit();
 }
     $user_id = $bean->getDetachedAttribute('timesheet_user_id');
     if (!ttTimesheetHelper::getTimesheetByName($cl_name, $user_id)) {
       if (ttTimesheetHelper::insert(array('user_id' => $user_id,
-        // 'client_id' => ?
+        'client_id' => $bean->getAttribute('client'),
         'name' => $cl_name,
         'comment' => $cl_comment))) {
           header('Location: timesheets.php');