Fix: bad rights

This commit is contained in:
Regis Houssin 2012-08-18 10:51:13 +02:00
parent 4aa8d0eb0c
commit 74c1fa2263

View File

@ -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');