Skip to content

Commit

Permalink
migration: add permissions for instance maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Dec 12, 2024
1 parent fe8308d commit c1a5721
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/migrations/20241128122149-add-permissions-maintenance.js
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit c1a5721

Please sign in to comment.