NEW: API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELD (#30562)
* introducing new global variable API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELDS, code copied and modified from public function getModules() * trying to use a different method to read the variable --------- Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
This commit is contained in:
parent
b974951a90
commit
f1678b7524
1 changed files with 3 additions and 2 deletions
|
|
@ -1199,8 +1199,9 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->admin) {
|
||||
throw new RestException(403, 'Only an admin user can get list of extrafields');
|
||||
if (!DolibarrApiAccess::$user->admin
|
||||
&& (!getDolGlobalString('API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELDS') || DolibarrApiAccess::$user->login != getDolGlobalString('API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELDS'))) {
|
||||
throw new RestException(403, 'Error API open to admin users only or to the users with logins defined into constant API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELDS');
|
||||
}
|
||||
|
||||
if ($elementtype == 'thirdparty') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue