1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/baikal_ynh.git synced 2024-09-03 18:16:11 +02:00

Merge pull request #48 from Salamandar/testing

Use Permissions system
This commit is contained in:
Éric Gaspar 2021-01-18 10:30:33 +01:00 committed by GitHub
commit a2f791d79c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -156,9 +156,9 @@ chmod 640 "$final_path/config/baikal.yaml"
ynh_script_progression --message="Configuring SSOwat..." --weight=2 ynh_script_progression --message="Configuring SSOwat..." --weight=2
# Allow public access on / # Allow public access on /
ynh_app_setting_set --app=$app --key=skipped_uris --value="/" ynh_permission_update --permission "main" --add "visitors"
# But restrain on /admin # But restrain on /admin
ynh_app_setting_set --app=$app --key=protected_uris --value="/admin/" ynh_permission_create --permission "admin" --url "/admin" --allowed "all_users"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX

View file

@ -188,10 +188,16 @@ chmod 640 "$final_path/config/baikal.yaml"
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=2 ynh_script_progression --message="Configuring SSOwat..." --weight=2
# Upgrade from the legacy permissions system
protected_uris=$(ynh_app_setting_get --app="$app" --key=protected_uris)
if [ -n "${protected_uris}" ]; then
ynh_app_setting_delete --app="$app" --key=protected_uris
# Allow public access on / # Allow public access on /
ynh_app_setting_set --app=$app --key=skipped_uris --value="/" ynh_permission_update --permission "main" --add "visitors"
# But restrain on /admin # But restrain on /admin
ynh_app_setting_set --app=$app --key=protected_uris --value="/admin/" ynh_permission_create --permission "admin" --url "/admin" --allowed "all_users"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX