mirror of
https://github.com/YunoHost-Apps/nodered_ynh.git
synced 2024-09-03 19:46:25 +02:00
Protect endpoints with is_public setting too
This commit is contained in:
parent
c68b0b8722
commit
07bac87075
1 changed files with 7 additions and 3 deletions
|
@ -159,10 +159,10 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||||
# The "main" permission is automatically created before the install script.
|
# The "main" permission is automatically created before the install script.
|
||||||
# Here we use it for the endpoints root, they should be world-accessible by default
|
# Here we use it for the endpoints root, they should be world-accessible by default
|
||||||
# Since it is meant for automated actions, we hide the tile from the SSO
|
# Since it is meant for automated actions, we hide the tile from the SSO
|
||||||
ynh_permission_create --permission="endpoints" --url="/" --allowed="visitors" --show_tile=false
|
ynh_permission_create --permission="endpoints" --url="/" --show_tile=false
|
||||||
|
|
||||||
# Create the dashboard UI permission
|
# Create the dashboard UI permission
|
||||||
ynh_permission_create --permission="ui" --url="/ui" --allowed="$admin" --show_tile=true
|
ynh_permission_create --permission="ui" --url="/ui" --show_tile=true
|
||||||
|
|
||||||
# Reuse the main permission for the admin
|
# Reuse the main permission for the admin
|
||||||
ynh_permission_url --permission="main" --url="/admin"
|
ynh_permission_url --permission="main" --url="/admin"
|
||||||
|
@ -171,7 +171,11 @@ ynh_permission_update --permission="main" --add="$admin" --remove="all_users" --
|
||||||
# Make the dashboard public if necessary
|
# Make the dashboard public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_permission_update --permission="ui" --remove="$admin" --add="visitors"
|
ynh_permission_update --permission="ui" --add="visitors"
|
||||||
|
ynh_permission_update --permission="endpoints" --add="visitors"
|
||||||
|
else
|
||||||
|
ynh_permission_update --permission="ui" --add="$admin"
|
||||||
|
ynh_permission_update --permission="endpoints" --add="$admin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue