forked from Wavyzz/dolibarr
Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -132,15 +132,15 @@ class Users extends DolibarrApi
|
||||
|
||||
/**
|
||||
* Get properties of an user object
|
||||
*
|
||||
* Return an array with user informations
|
||||
*
|
||||
* @param int $id ID of user
|
||||
* @param int $id ID of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
public function get($id, $includepermissions = 0)
|
||||
{
|
||||
//if (!DolibarrApiAccess::$user->rights->user->user->lire) {
|
||||
//throw new RestException(401);
|
||||
@@ -157,6 +157,10 @@ class Users extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if ($includepermissions) {
|
||||
$this->useraccount->getRights();
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->useraccount);
|
||||
}
|
||||
|
||||
@@ -544,6 +548,12 @@ class Users extends DolibarrApi
|
||||
unset($object->clicktodial_password);
|
||||
unset($object->openid);
|
||||
|
||||
unset($object->lines);
|
||||
unset($object->modelpdf);
|
||||
unset($object->skype);
|
||||
unset($object->twitter);
|
||||
unset($object->facebook);
|
||||
unset($object->linkedin);
|
||||
|
||||
$canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read))
|
||||
|| (!empty($conf->hrm->enabled) && !empty(DolibarrApiAccess::$user->rights->hrm->employee->read)));
|
||||
|
||||
Reference in New Issue
Block a user