mirror of
https://github.com/YunoHost-Apps/hextris_ynh.git
synced 2024-09-03 19:16:05 +02:00
Update migration from old permissions system in upgrade
This commit is contained in:
parent
c5881df544
commit
a90151a662
1 changed files with 14 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -37,14 +38,23 @@ if [ -z "$final_path" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Migrate from legacy permission system
|
# Migrate from legacy permission system
|
||||||
|
|
||||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||||
|
|
||||||
if [ -n "$is_public" ]; then
|
if [ -n "$is_public" ]; then
|
||||||
ynh_app_setting_delete --app=$app --key=skipped_uris
|
# Remove unprotected_uris
|
||||||
if [ $is_public -eq 1 ]; then
|
ynh_app_setting_delete --app=$app --key=unprotected_uris
|
||||||
|
# Remove protected_uris
|
||||||
|
ynh_app_setting_delete --app=$app --key=protected_uris
|
||||||
|
|
||||||
|
# Removing skipped/unprotected_uris under certain conditions, remove the visitors group added during the migration process of 3.7
|
||||||
|
# Remove skipped_uris. If the app was public, add visitors again to the main permission
|
||||||
|
if ynh_permission_has_user --permission=main --user=visitors
|
||||||
|
then
|
||||||
|
ynh_app_setting_delete --app=$app --key=skipped_uris
|
||||||
ynh_permission_update --permission "main" --add "visitors"
|
ynh_permission_update --permission "main" --add "visitors"
|
||||||
fi
|
else
|
||||||
|
ynh_app_setting_delete --app=$app --key=skipped_uris
|
||||||
|
fi
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue