diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index c9d7672e7f3..2a23ee5eb85 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -60,7 +60,7 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount'); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 69c3f1b2a6f..02921a78cb2 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -79,7 +79,7 @@ $search_country_id = GETPOST('search_country_id', 'int'); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index f9abb5e292c..36b9f3a8b93 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -49,7 +49,7 @@ $label = GETPOST('label', 'alpha'); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index f8837bc81c8..7b86902e009 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -45,7 +45,7 @@ if ($cat_id == 0) { } // Security check -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index de80b1301c0..3a6664b8b44 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -43,7 +43,7 @@ $rowid = GETPOST('rowid', 'alpha'); $code = GETPOST('code', 'alpha'); // Security access -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php index e3f979db6a3..5ad23febb36 100644 --- a/htdocs/accountancy/admin/closure.php +++ b/htdocs/accountancy/admin/closure.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; $langs->loadLangs(array("compta", "admin", "accountancy")); // Security check -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index bfc1fd29316..9a3b63adcc3 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "loan")); // Security check -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index d0a0ab671d4..23a16340c0b 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; $langs->loadLangs(array("compta", "bills", "admin", "accountancy")); // Security access -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index ed5ced40f7f..22d39dea7d0 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other")); // Security access -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 414205f6bc6..8d350afbb07 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -46,7 +46,7 @@ $rowid = GETPOST('rowid', 'alpha'); $code = GETPOST('code', 'alpha'); // Security access -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 89ef81b3996..c9f78596bcd 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -48,7 +48,7 @@ $search_type = GETPOST('search_type', 'int'); if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->chartofaccount)) { +if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 2745ab4784a..21c736900aa 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -44,7 +44,7 @@ if ($user->socid > 0) { if (!isModEnabled('accounting')) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } */ diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5f4c8453bab..f55190f7bf8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -55,13 +55,13 @@ $entity = GETPOST('entity', 'int'); $code = GETPOST('code', 'alpha'); $allowed = $user->admin; -if ($id == 7 && !empty($user->rights->accounting->chartofaccount)) { +if ($id == 7 && $user->hasRight('accounting', 'chartofaccount')) { $allowed = 1; // Tax page allowed to manager of chart account } -if ($id == 10 && !empty($user->rights->accounting->chartofaccount)) { +if ($id == 10 && $user->hasRight('accounting', 'chartofaccount')) { $allowed = 1; // Vat page allowed to manager of chart account } -if ($id == 17 && !empty($user->rights->accounting->chartofaccount)) { +if ($id == 17 && $user->hasRight('accounting', 'chartofaccount')) { $allowed = 1; // Dictionary with type of expense report and accounting account allowed to manager of chart account } if (!$allowed) { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 213d31b2012..48ddda5db2c 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -70,7 +70,7 @@ if ($user->socid) { } $allowed = 0; -if (!empty($user->rights->accounting->chartofaccount)) { +if ($user->hasRight('accounting', 'chartofaccount')) { $allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account } if (!$allowed) {