From 22503375b3039585ebe6104400f34186a305aad5 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 4 Aug 2022 08:53:31 +0200 Subject: [PATCH] Hotfix: User synchronization --- modules/account/back/models/role-config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/account/back/models/role-config.js b/modules/account/back/models/role-config.js index 6051f2060a..ba7bf9d523 100644 --- a/modules/account/back/models/role-config.js +++ b/modules/account/back/models/role-config.js @@ -56,6 +56,12 @@ module.exports = Self => { if (!userExists) { await Self.rawSql('CREATE USER ?@? IDENTIFIED BY ?', [mysqlUser, this.userHost, password]); + await Self.rawSql( + `UPDATE mysql.global_priv + SET Priv = JSON_SET(Priv, '$.autogenerated' , TRUE) + WHERE User = ? AND Host = ?`, + [mysqlUser, this.userHost] + ); userExists = true; } else { switch (this.dbType) {