diff --git a/htdocs/includes/modules/modProjet.class.php b/htdocs/includes/modules/modProjet.class.php index 9e088d47062..7d6aa91b4f7 100644 --- a/htdocs/includes/modules/modProjet.class.php +++ b/htdocs/includes/modules/modProjet.class.php @@ -121,7 +121,7 @@ class modProjet extends DolibarrModules $this->rights[$r][0] = 141; // id de la permission $this->rights[$r][1] = "Lire tous les projets et taches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'lire'; diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index a48625ff69f..61fe079c35b 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -113,6 +113,7 @@ if ($mesg) print $mesg; $tasksarray=$task->getTasksArray(0,0,$project->id,0); $tasksrole=$task->getUserRolesForProjectsOrTasks($user,0,$project->id,0); //var_dump($tasksarray); +var_dump($tasksrole); print '
'; print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 8175a75f0f2..3950c1fd1c6 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -127,7 +127,7 @@ $sql.= ", s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; $sql.= " WHERE p.entity = ".$conf->entity; -$sql.= " AND p.rowid IN (".$projectsListId.")"; +if (!$user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; if ($socid) $sql.= " AND s.rowid = ".$socid; $sql.= " GROUP BY s.nom, s.rowid"; diff --git a/htdocs/projet/project.class.php b/htdocs/projet/project.class.php index 1aad2f539bb..f1028b002d3 100644 --- a/htdocs/projet/project.class.php +++ b/htdocs/projet/project.class.php @@ -612,7 +612,7 @@ class Project extends CommonObject { // To verify role of users $userAccess = 0; - if (!empty($this->user_author_id) && $this->user_author_id == $user->id) + if ((!empty($this->user_author_id) && $this->user_author_id == $user->id) || $user->rights->projet->all->lire) { $userAccess = 1; }