mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
use user hasRight
This commit is contained in:
parent
f96293f503
commit
f9a1fbf410
|
|
@ -55,7 +55,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Define variables to know what current user can do on properties of user linked to edited member
|
||||
if ($object->user_id) {
|
||||
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
|
||||
$caneditfielduser = ((($user->id == $object->user_id) && !empty($user->rights->user->self->creer))
|
||||
$caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'creer'))
|
||||
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'creer')));
|
||||
$caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'password'))
|
||||
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'password')));
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ if (empty($account->userid)) {
|
|||
// Define value to know what current user can do on users
|
||||
$canadduser = (!empty($user->admin) || $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write);
|
||||
$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire || $user->rights->hrm->read_personal_information->read);
|
||||
$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer));
|
||||
$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || $user->hasRight('user', 'creer'));
|
||||
$permissiontoreadhr = $user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write');
|
||||
$permissiontowritehr = $user->hasRight('hrm', 'write_personal_information', 'write');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user