Fix: bad rights
This commit is contained in:
parent
2e38300ec4
commit
d6f1f870a2
@ -46,17 +46,17 @@ if (!$user->rights->projet->lire) accessforbidden();
|
||||
$object = new Task($db);
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -78,18 +78,20 @@ if (! empty($project_ref) && ! empty($withproject))
|
||||
}
|
||||
}
|
||||
|
||||
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
||||
if ($action == 'setnote_public' && ! empty($permission))
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
||||
else if ($action == 'setnote_private' && ! empty($permission))
|
||||
{
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
@ -203,7 +205,6 @@ if ($object->id > 0)
|
||||
print '<br>';
|
||||
|
||||
$colwidth=30;
|
||||
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
|
||||
$moreparam=$param;
|
||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user