1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

fix: adding missing project column to roles

This commit is contained in:
Christopher Kolstad 2022-02-22 15:10:06 +01:00 committed by Ivar Conradi Østhus
parent 951d4fc6bc
commit 615963b8ce
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09

View File

@ -0,0 +1,24 @@
'use strict';
const async = require('async');
function resolveRoleName(permissions) {
if (!permissions || permissions.length === 0) {
return 'Viewer';
}
if (permissions.includes('ADMIN')) {
return 'Admin';
}
return 'Editor';
}
exports.up = function (db, cb) {
db.runSql(
'ALTER TABLE roles ADD COLUMN IF NOT EXISTS project text', cb
);
};
exports.down = function (db, cb) {
// We can't just remove roles for users as we don't know if there has been any manual additions.
cb();
};