From 76ad8d900b29090e0d28fac6877db0f2fe1f92a8 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 11 Oct 2023 21:39:51 +0200 Subject: [PATCH] Fix admin permissions and setup --- manifest.toml | 4 ++++ scripts/install | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/manifest.toml b/manifest.toml index 1863baf..2c869ae 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,6 +42,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [install.admin] type = "user" + help.en = "Choose the Dotclear super user. By default, all users in the admin group will be admins of Dotclear." [resources] [resources.sources.latest] @@ -62,6 +63,9 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" + admin.url = "/admin" + admin.show_tile = false + admin.allowed = "admins" [resources.apt] packages = "mariadb-server, php8.2, php8.2-fpm, php8.2-mbstring, php8.2-mysql, php-iconv, php8.2-xml, php8.2-cli, php8.2-intl, php8.2-ldap" diff --git a/scripts/install b/scripts/install index 304602c..862b3da 100755 --- a/scripts/install +++ b/scripts/install @@ -116,6 +116,9 @@ chown $app:$app "$php_config" #================================================= ynh_script_progression --message="Finalizing installation..." --weight=14 +# Give the admin the proper permission and give temporary admin access to visitors +ynh_permission_update --permission="admin" --add="$admin" "visitors" + firstname=$(ynh_user_get_info --username=$admin --key=firstname) lastname=$(ynh_user_get_info --username=$admin --key=lastname) email=$(ynh_user_get_info --username=$admin --key=mail) @@ -127,6 +130,9 @@ installUrl="/admin/install/index.php" ynh_local_curl $installUrl "u_email=$email" "u_firstname=$firstname" "u_name=$lastname" "u_login=$admin" "u_pwd=$password" "u_pwd2=$password" +# Remove visitor access to admin +ynh_permission_update --permission="admin" --remove="visitors" + #================================================= # GENERIC FINALIZATION #=================================================