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); +}