mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
api_accounts fillApiPermissions if empty
This commit is contained in:
parent
53b228b06c
commit
bef8e02217
@ -802,7 +802,7 @@ if (!function_exists('getallheaders')) {
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
private function fillApiPermissions()
|
||||
function fillApiPermissions()
|
||||
{
|
||||
foreach ($this->getGroupedPermissions() as $group => $permissions){
|
||||
foreach ($permissions as $permission){
|
||||
|
@ -267,6 +267,12 @@ class Api_account
|
||||
|
||||
$apiPermissions = $this->app->DB->SelectArr("SELECT * FROM `api_permission`");
|
||||
|
||||
if (empty($apiPermissions)) {
|
||||
$api = $this->app->loadModule('api');
|
||||
$api->fillApiPermissions();
|
||||
$apiPermissions = $this->app->DB->SelectArr("SELECT * FROM `api_permission`");
|
||||
}
|
||||
|
||||
$groupedApiPermissions = [];
|
||||
foreach ($apiPermissions as $apiPermission){
|
||||
$groupedApiPermissions[$apiPermission['group']][] =$apiPermission;
|
||||
|
Loading…
Reference in New Issue
Block a user