Fix perms
This commit is contained in:
parent
adb20c6a90
commit
b648f30482
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user