Commit 8dc313f1 authored by Steffen Köhler's avatar Steffen Köhler
Browse files

New approach to fetch all permissions.

parent 8a6373a1
Pipeline #10797 passed with stages
in 3 minutes and 4 seconds
......@@ -13,8 +13,6 @@ permission_id=""
permissions=""
module_descriptor=""
tenantParameters=""
passage=0
parse_cmdline_parameters() {
! getopt --test >/dev/null
......@@ -313,7 +311,6 @@ install_modules() {
local module
for module in $@; do
if [[ ${module} == mod-authtoken* ]] && [ ${passage} -eq 0 ]; then echo "Will skip"; break; fi
read -r -d '' part <<EOF
{
"id": "${module}",
......@@ -350,7 +347,6 @@ EOF
done
echo "${result##*|} ("${result%|*}")"
let passage=1
return 12
}
......@@ -568,8 +564,9 @@ get_permissions() {
-X GET \
-H "Content-type: application/json" \
-H "X-Okapi-Tenant: ${tenant_id}" \
-H "X-Okapi-Token: ${okapi_token}" \
--connect-timeout ${CURL_CONNECT_TIMEOUT} \
"${OKAPI_URL}/perms/permissions?query=visible%3D%3Dtrue&length=2000" 2>&1`
"${OKAPI_URL}/perms/permissions?query=childOf%3D%3D%5B%5D&length=4000" 2>&1`
case "${result##*|}" in
200|201)
......@@ -603,6 +600,7 @@ EOF
-X POST \
-H "Content-type: application/json" \
-H "X-Okapi-Tenant: ${tenant_id}" \
-H "X-Okapi-Token: ${okapi_token}" \
--connect-timeout ${CURL_CONNECT_TIMEOUT} \
"${OKAPI_URL}/perms/users/${permission_id}/permissions" \
-d @- 2>&1`
......@@ -638,13 +636,16 @@ main() {
&& register_frontend_modules $frontend_modules \
&& (tenant_exists || create_tenant) \
&& wait_for_backend_modules $backend_modules && install_modules $modules \
&& find_module_authtoken \
&& disable_module_for_tenant $authtoken \
&& create_admin \
&& create_admin_credentials \
&& create_admin_permission "perms.all" \
&& get_permissions \
&& assign_permissions $permissions \
&& install_modules $modules \
&& login
&& login \
&& get_permissions \
&& assign_permissions $permissions
return $?
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment