diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
index 99ae0bd845b..bd48c205dae 100644
--- a/htdocs/accountancy/index.php
+++ b/htdocs/accountancy/index.php
@@ -49,7 +49,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) {
accessforbidden();
}
-if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->comptarapport->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) {
+if (empty($user->hasRight('compta', 'resultat', 'lire')) && empty($user->hasRight('accounting', 'comptarapport', 'lire')) && empty($user->hasRight('accounting', 'mouvements', 'lire')) && empty($user->hasRight('asset', 'read')) && empty($user->hasRight('intracommreport', 'read'))) {
accessforbidden();
}
diff --git a/htdocs/document.php b/htdocs/document.php
index a33708e3e77..e432d6a92f1 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -120,7 +120,7 @@ if ($user->socid > 0) {
// For some module part, dir may be privates
if (in_array($modulepart, array('facture_paiement', 'unpaid'))) {
- if (empty($user->rights->societe->client->voir) || $socid) {
+ if (empty($user->hasRight('societe', 'client', 'voir')) || $socid) {
$original_file = 'private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user
}
}
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 51a50c6376c..7aa566630c3 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -1818,7 +1818,7 @@ if ($step == 5 && $datatoimport) {
// Actions
print '
';
- if ($user->rights->import->run) {
+ if ($user->hasRight('import', 'run')) {
print '
';
} else {
print '
'.$langs->trans("RunSimulateImportFile").'';
@@ -1974,7 +1974,7 @@ if ($step == 5 && $datatoimport) {
// Actions
print '
';
- if ($user->rights->import->run) {
+ if ($user->hasRight('import', 'run')) {
if (empty($nboferrors)) {
print '
'.$langs->trans("RunImportFile").'';
} else {
diff --git a/htdocs/index.php b/htdocs/index.php
index 6715577e615..afce0c5e553 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -155,7 +155,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
// Number of actions to do (late)
- if (isModEnabled('agenda') && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) {
+ if (isModEnabled('agenda') && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->hasRight('agenda', 'myactions', 'read')) {
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$board = new ActionComm($db);
$dashboardlines[$board->element] = $board->load_board($user);
@@ -202,7 +202,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
// Number of suppliers orders a deal
- if (isModEnabled('supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) {
+ if (isModEnabled('supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight('fournisseur', 'commande', 'lire')) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$board = new CommandeFournisseur($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
@@ -235,7 +235,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
// Number of supplier invoices (paid)
- if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) {
+ if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->hasRight('fournisseur', 'facture', 'lire'))) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$board = new FactureFournisseur($db);
$dashboardlines[$board->element] = $board->load_board($user);