From c1a5721fe790ec5c102321a9fe167a302fa82ec4 Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:10:26 +0100 Subject: [PATCH] migration: add permissions for instance maintenance --- .../20241128122149-add-permissions-maintenance.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/migrations/20241128122149-add-permissions-maintenance.js diff --git a/src/migrations/20241128122149-add-permissions-maintenance.js b/src/migrations/20241128122149-add-permissions-maintenance.js new file mode 100644 index 000000000000..a38fc32fa1b8 --- /dev/null +++ b/src/migrations/20241128122149-add-permissions-maintenance.js @@ -0,0 +1,14 @@ +'use strict'; + +exports.up = function (db, cb) { + db.runSql(` + INSERT INTO permissions (permission, display_name, type) VALUES ('UPDATE_MAINTENANCE_MODE', 'Change maintenance mode state', 'root'); + INSERT INTO permissions (permission, display_name, type) VALUES ('UPDATE_INSTANCE_BANNERS', 'Change instance banners', 'root'); + `, cb); +} + +exports.down = function (db, cb) { + db.runSql(` + DELETE FROM permissions WHERE permission IN ('UPDATE_MAINTENANCE_MODE', 'UPDATE_INSTANCE_BANNERS'); + `, cb); +}