Fix permission test
This commit is contained in:
parent
ca7b9efec2
commit
9a831e3249
@ -65,6 +65,9 @@ if (empty($action) && empty($id) && empty($ref)) $action = 'view';
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (!empty($user->socid)) $socid = $user->socid;
|
||||||
|
$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
$permissiontoread = $user->rights->asset->read;
|
$permissiontoread = $user->rights->asset->read;
|
||||||
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
|
|||||||
@ -68,6 +68,10 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (!empty($user->socid)) $socid = $user->socid;
|
||||||
|
$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->id);
|
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->id);
|
||||||
if ($id > 0 || !empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity]."/packages/".dol_sanitizeFileName($object->ref);
|
if ($id > 0 || !empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity]."/packages/".dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
|
|||||||
@ -35,15 +35,17 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid) $socid = $user->socid;
|
if ($user->socid) $socid = $user->socid;
|
||||||
$result = restrictedArea($user, 'asset', $id, '');
|
$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
$object = new Asset($db);
|
$object = new Asset($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// None
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -73,12 +73,15 @@ if (!$sortorder) $sortorder = "ASC";
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
|
if ($user->socid) $socid = $user->socid;
|
||||||
if ($user->socid > 0) // Protection if external user
|
if ($user->socid > 0) // Protection if external user
|
||||||
{
|
{
|
||||||
//$socid = $user->socid;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
//$result = restrictedArea($user, 'asset', $id,'');
|
// Security check
|
||||||
|
$result = restrictedArea($user, 'asset', $id, '');
|
||||||
|
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = GETPOST("search_all", 'alpha');
|
$search_all = GETPOST("search_all", 'alpha');
|
||||||
|
|||||||
@ -54,6 +54,10 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || !empty($ref)) $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id;
|
if ($id > 0 || !empty($ref)) $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id;
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (!empty($user->socid)) $socid = $user->socid;
|
||||||
|
$result = restrictedArea($user, 'asset', $id);
|
||||||
|
|
||||||
$permissionnote = 1;
|
$permissionnote = 1;
|
||||||
//$permissionnote=$user->rights->asset->creer; // Used by the include of actions_setnotes.inc.php
|
//$permissionnote=$user->rights->asset->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user