mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
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:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user