1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

fix: adding missing project column to roles

This commit is contained in:
Christopher Kolstad 2022-02-22 15:10:06 +01:00
parent 94426c09e5
commit 4f0bca4d19
No known key found for this signature in database
GPG Key ID: 559ACB0E3DB5538A

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