diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php
index 7e445e41a37..ea5e22fe153 100644
--- a/htdocs/adherents/note.php
+++ b/htdocs/adherents/note.php
@@ -51,7 +51,7 @@ if ($result > 0) {
}
-$permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('adherent', 'creer'); // Used by the include of actions_setnotes.inc.php
// Fetch object
if ($id > 0 || !empty($ref)) {
@@ -71,10 +71,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
-$canaddmember = $user->rights->adherent->creer;
+$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
- $caneditfieldmember = $user->rights->adherent->creer;
+ $caneditfieldmember = $user->hasRight('adherent', 'creer');
}
$hookmanager->initHooks(array('membernote'));
@@ -155,7 +155,7 @@ if ($id) {
$cssclass = 'titlefield';
- $permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
+ $permission = $user->hasRight('adherent', 'creer'); // Used by the include of notes.tpl.php
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 67c2ffef1d0..8700c3669ea 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -112,10 +112,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
-$canaddmember = $user->rights->adherent->creer;
+$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
- $caneditfieldmember = $user->rights->adherent->creer;
+ $caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check
@@ -594,7 +594,7 @@ if ($rowid > 0) {
print '
';
@@ -636,7 +636,7 @@ if ($rowid > 0) {
print '| ';
print $langs->trans("LinkedToDolibarrUser");
print ' | ';
- if ($action != 'editlogin' && $user->rights->adherent->creer) {
+ if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
print '';
if ($user->rights->user->user->creer) {
print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'';
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index b6463e006a9..df74a1e33b7 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -753,7 +753,7 @@ if ($rowid > 0) {
// Actions
print ' | ';
- if ($user->rights->adherent->creer) {
+ if ($user->hasRight('adherent', 'creer')) {
print 'id).'">'.img_edit().'';
}
if ($user->rights->adherent->supprimer) {
diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php
index 902206c7874..235488b1290 100644
--- a/htdocs/adherents/vcard.php
+++ b/htdocs/adherents/vcard.php
@@ -53,10 +53,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
-$canaddmember = $user->rights->adherent->creer;
+$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
- $caneditfieldmember = $user->rights->adherent->creer;
+ $caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check
|