Added GET API call for group-permissions

This commit is contained in:
2026-06-14 23:12:17 +02:00
parent a7e3c54a89
commit b088314c38
2 changed files with 14 additions and 1 deletions

View File

@@ -120,4 +120,13 @@ class API_permissions extends API
return $access_rights; return $access_rights;
} }
public function getUserGroupPermissions()
{
list($query, $types, $params) = $this->buildDynamicQuery('system_user_group_permissions');
$items = $this->generalGetFunction($query, $types, $params, false, 'userGroupPermissions');
return ($items);
}
} }

View File

@@ -11,7 +11,11 @@ $API_permissions = new API_permissions();
$API_usergroups = new API_usergroups(); $API_usergroups = new API_usergroups();
if ($API_permissions->request_method === 'GET') { if ($API_permissions->request_method === 'GET') {
# to be made, get all the access-rights and implement the builder $API_usergroups->checkPermissions('admin-access-control-permissions', 'RO');
$permissions = $API_permissions->getUserGroupPermissions();
$API_permissions->apiOutput($code = 200, ['success' => $permissions]);
} elseif ($API_permissions->request_method === 'PUT') { } elseif ($API_permissions->request_method === 'PUT') {
# when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection # when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection