From dcd2952357dd7f49c779c4d25f63c4fe83b556b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 8 Feb 2019 15:50:30 +0100 Subject: [PATCH] Add possibility to set a user as admin --- actions.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/actions.json b/actions.json index 4a9cdb4..a7a05e7 100644 --- a/actions.json +++ b/actions.json @@ -25,4 +25,23 @@ "description": { "en": "Close the ports range 49153:49193 with TCP and UDP. (Undo \"Open ports for turnserver\" action)" } +},{ + "id": "set_admin_user", + "name": "Set a user as admin", + "command": "[[ \"$(su --command=\"psql matrix_synapse\" postgres <<< \"UPDATE users SET admin = 1 WHERE name = '@$YNH_ACTION_USERNAME:$(yunohost app setting $YNH_APP_INSTANCE_NAME special_domain)'\")\" == 'UPDATE 1' ]]", + "user": "root", + "accepted_return_codes": [0], + "description": { + "en": "Set a synapse user as admin in the synapse server. It probably usefull only to manage the community function." + }, + "arguments": [ + { + "name": "username", + "type": "string", + "ask": { + "en": "username of the user to set as admin" + }, + "example": "bob" + } + ] }]