Merge pull request #12570 from atm-maxime/fix_margin_rights
Fix margin rights
This commit is contained in:
commit
47b35e9011
@ -52,7 +52,7 @@ function societe_prepare_head(Societe $object)
|
||||
|
||||
if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES))
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
||||
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->societe->contact->lire)
|
||||
{
|
||||
//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
|
||||
$nbContact = 0; // TODO
|
||||
|
||||
@ -165,9 +165,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
||||
if (! empty($conf->salaries->enabled)) $menuqualified++;
|
||||
if (! empty($conf->supplier_invoice->enabled)) $menuqualified++;
|
||||
if (! empty($conf->loan->enabled)) $menuqualified++;
|
||||
if (! empty($conf->margins->enabled)) $menuqualified++;
|
||||
$tmpentry=array(
|
||||
'enabled'=>$menuqualified,
|
||||
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)),
|
||||
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->margins->liretous)),
|
||||
'module'=>'facture|supplier_invoice|don|tax|salaries|loan');
|
||||
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
|
||||
if ($showmode)
|
||||
|
||||
@ -42,7 +42,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||
$result=restrictedArea($user,'margins');
|
||||
if(empty($user->rights->margins->liretous)) accessforbidden();
|
||||
|
||||
$mesg = '';
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||
if(empty($user->rights->margins->liretous)) accessforbidden();
|
||||
|
||||
$object = new Product($db);
|
||||
|
||||
|
||||
@ -88,6 +88,7 @@ if (! empty($canvas))
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas);
|
||||
if(empty($user->rights->societe->contact->lire)) accessforbidden();
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user