mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 14:10:28 +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;
|
return $permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function fillApiPermissions()
|
function fillApiPermissions()
|
||||||
{
|
{
|
||||||
foreach ($this->getGroupedPermissions() as $group => $permissions){
|
foreach ($this->getGroupedPermissions() as $group => $permissions){
|
||||||
foreach ($permissions as $permission){
|
foreach ($permissions as $permission){
|
||||||
|
@ -267,6 +267,12 @@ class Api_account
|
|||||||
|
|
||||||
$apiPermissions = $this->app->DB->SelectArr("SELECT * FROM `api_permission`");
|
$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 = [];
|
$groupedApiPermissions = [];
|
||||||
foreach ($apiPermissions as $apiPermission){
|
foreach ($apiPermissions as $apiPermission){
|
||||||
$groupedApiPermissions[$apiPermission['group']][] =$apiPermission;
|
$groupedApiPermissions[$apiPermission['group']][] =$apiPermission;
|
||||||
|
Loading…
Reference in New Issue
Block a user