Fix perms

This commit is contained in:
Laurent Destailleur 2020-06-01 14:52:26 +02:00
parent adb20c6a90
commit b648f30482
2 changed files with 3 additions and 3 deletions

View File

@ -527,8 +527,8 @@ class MyObject extends CommonObject
return 0;
}
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->myobject->create))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->myobject->myobject_advance->validate))))
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->write))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->myobject_advance->validate))))
{
$this->error='NotEnoughPermissions';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);

View File

@ -563,7 +563,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->mymodule->myobject->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->mymodule->myobject->create; // If you can create/edit, you can remove a file on card
$delallowed = $user->rights->mymodule->myobject->write; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule:myobject', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}