Fix: bad rights for user author
This commit is contained in:
parent
77d5efde98
commit
496f305a81
@ -177,6 +177,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
$userAccess = 0;
|
$userAccess = 0;
|
||||||
|
if (!empty($project->user_author_id) && $project->user_author_id == $user->id) $userAccess=1;
|
||||||
|
else
|
||||||
|
{
|
||||||
foreach(array('internal','external') as $source)
|
foreach(array('internal','external') as $source)
|
||||||
{
|
{
|
||||||
$userRole = $project->liste_contact(4,$source);
|
$userRole = $project->liste_contact(4,$source);
|
||||||
@ -192,6 +195,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$head = project_prepare_head($project);
|
$head = project_prepare_head($project);
|
||||||
dol_fiche_head($head, 'contact', $langs->trans("Project"), 0, 'project');
|
dol_fiche_head($head, 'contact', $langs->trans("Project"), 0, 'project');
|
||||||
|
|||||||
@ -323,8 +323,7 @@ else
|
|||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
$userAccess = 0;
|
$userAccess = 0;
|
||||||
var_dump($project);
|
if (!empty($project->user_author_id) && $project->user_author_id == $user->id) $userAccess=1;
|
||||||
if (empty($project->user_author_id)) $userAccess=1;
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach(array('internal','external') as $source)
|
foreach(array('internal','external') as $source)
|
||||||
|
|||||||
@ -108,6 +108,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
$userAccess = 0;
|
$userAccess = 0;
|
||||||
|
if (!empty($project->user_author_id) && $project->user_author_id == $user->id) $userAccess=1;
|
||||||
|
else
|
||||||
|
{
|
||||||
foreach(array('internal','external') as $source)
|
foreach(array('internal','external') as $source)
|
||||||
{
|
{
|
||||||
$userRole = $project->liste_contact(4,$source);
|
$userRole = $project->liste_contact(4,$source);
|
||||||
@ -123,6 +126,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$head = project_prepare_head($project);
|
$head = project_prepare_head($project);
|
||||||
dol_fiche_head($head, 'note', $langs->trans('Project'), 0, 'project');
|
dol_fiche_head($head, 'note', $langs->trans('Project'), 0, 'project');
|
||||||
|
|||||||
@ -120,6 +120,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
$userAccess = 0;
|
$userAccess = 0;
|
||||||
|
if (!empty($project->user_author_id) && $project->user_author_id == $user->id) $userAccess=1;
|
||||||
|
else
|
||||||
|
{
|
||||||
foreach(array('internal','external') as $source)
|
foreach(array('internal','external') as $source)
|
||||||
{
|
{
|
||||||
$userRole = $project->liste_contact(4,$source);
|
$userRole = $project->liste_contact(4,$source);
|
||||||
@ -136,6 +139,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'create' && $user->rights->projet->task->creer && $userAccess)
|
if ($_GET["action"] == 'create' && $user->rights->projet->task->creer && $userAccess)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user