diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c8bfd09bcd5..abb906513e7 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1590,7 +1590,7 @@ class ActionComm extends CommonObject } $canread = 0; - if (!empty($user->rights->agenda->myactions->read) && $this->authorid == $user->id) { + if ($user->hasRight('agenda', 'myactions', 'read') && ($this->authorid == $user->id || $this->userownerid == $user->id)) { $canread = 1; // Can read my event } if (!empty($user->rights->agenda->myactions->read) && array_key_exists($user->id, $this->userassigned)) { diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 0b90bccd135..08c0c25bbd4 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -926,6 +926,7 @@ while ($i < $imaxinloop) { $actionstatic->datep = $db->jdate($obj->dp); $actionstatic->percentage = $obj->percent; $actionstatic->authorid = $obj->fk_user_author; + $actionstatic->userownerid = $obj->fk_user_action; // Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid // but only if we need it