Skip to content

Commit

Permalink
Revert "[fix] #89: Use new permission system"
Browse files Browse the repository at this point in the history
This reverts commit 39f75cd.
The permission system is not fully ready yet, since we can not protect
two paths
  • Loading branch information
M5oul committed Oct 3, 2020
1 parent 363a4b4 commit 843e745
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions scripts/functions.sh
Expand Up @@ -31,22 +31,17 @@ CONFIGURE_DUNITER () {
}

CONFIG_SSOWAT () {
# Protect senstive sub-routes to Duniter web admin interface, give access to choosen admin
if ! ynh_permission_exists --permission "admin"; then
ynh_permission_create --permission "admin" --url "/webui","/webmin" --allowed "$admin"
fi
# Add admin to the allowed users
yunohost app addaccess $app -u $admin

# Protect senstive sub-routes
ynh_app_setting_set "$app" protected_uris "/webui","/webmin"

# Add access to BMA
ynh_permission_update --permission main --add visitors
# Duniter is public app, with only some parts restricted in nginx.conf
ynh_app_setting_set "$app" unprotected_uris "/","/modules"

# Set URL redirection from root to webadmin
ynh_app_setting_set "$app" redirected_urls "{'$domain/':'$domain/webui'}"

# Remove deprecated permission system settings
if [ ! -z "$(ynh_app_setting_get --app=$app --key=protected_uris)" ]; then
ynh_app_setting_delete --app=$app --key=protected_uris
ynh_app_setting_delete --app=$app --key=unprotected_uris
fi
}

CONFIG_NGINX () {
Expand Down

0 comments on commit 843e745

Please sign in to comment.