2
0
forked from Wavyzz/dolibarr

FIX : Add the possibility to events oxwner to check their events from the list when the perm "Read the actions (events or tasks) of others" is not active

This commit is contained in:
Adrien Raze
2023-04-03 10:13:11 +02:00
parent b1d15cdc0e
commit 1d59cdc41b
2 changed files with 2 additions and 1 deletions

View File

@@ -1566,7 +1566,7 @@ class ActionComm extends CommonObject
}
$canread = 0;
if ($user->rights->agenda->myactions->read && $this->authorid == $user->id) {
if ($user->rights->agenda->myactions->read && ($this->authorid == $user->id || $this->userownerid == $user->id)) {
$canread = 1; // Can read my event
}
if ($user->rights->agenda->myactions->read && array_key_exists($user->id, $this->userassigned)) {

View File

@@ -917,6 +917,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