protected $_params;
/**
+ * The event's owner.
+ *
+ * @var string
+ */
+ protected $_owner;
+
+ /**
* A bitmask of permissions the current user has on this object.
*
* @var integer
$this->recurrence = $recurrence;
}
-
+ if (isset($event['owner'])) {
+ $this->_owner = $event['owner'];
+ }
if (isset($event['permissions'])) {
$this->_permissions = $event['permissions'];
}
*/
public function hasPermission($permission, $user = null)
{
+ if ($user === null) {
+ $user = $GLOBALS['registry']->getAuth();
+ }
+
+ if (isset($this->_owner) && $this->_owner == $user) {
+ return true;
+ }
+
if (isset($this->_permissions)) {
return (bool)($this->_permissions & $permission);
}
'end' => $due_date,
'category' => $task->category,
'color' => $allowed_tasklists[$task->tasklist]->get('color'),
+ 'owner' => $allowed_tasklists[$task->tasklist]->get('owner'),
'permissions' => $GLOBALS['nag_shares']->getPermissions($task->tasklist, $GLOBALS['registry']->getAuth()),
'variable_length' => false,
'params' => array('task' => $task->id,