Fix permissions
This commit is contained in:
parent
73f63509e3
commit
23d19a8af3
@ -82,21 +82,6 @@ if (empty($origin_id)) {
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
|
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = '';
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($origin == 'expedition') {
|
|
||||||
$result = restrictedArea($user, $origin, $id);
|
|
||||||
} else {
|
|
||||||
$result = restrictedArea($user, 'expedition');
|
|
||||||
if (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
@ -121,18 +106,24 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
|
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
|
||||||
|
|
||||||
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
|
|
||||||
//var_dump($object->lines[0]->detail_batch);
|
|
||||||
|
|
||||||
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
||||||
|
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$object->fetch($id, $ref);
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
|
$socid = '';
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = restrictedArea($user, 'expedition', $object->id, '');
|
$result = restrictedArea($user, 'expedition', $object->id, '');
|
||||||
|
|
||||||
|
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
|
||||||
|
//var_dump($object->lines[0]->detail_batch);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -108,13 +108,6 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
elseif ($action == 'setaddress' && $user->rights->expedition->creer)
|
|
||||||
{
|
|
||||||
$object->fetch($id);
|
|
||||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
|
||||||
if ($result < 0) dol_print_error($db,$object->error);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user