mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
3b42e866ec
feat: adds a way to specify a root role on a group, which will cause any user entering into that group to take on the permissions of that root role Co-authored-by: Nuno Góis <github@nunogois.com>
25 lines
582 B
JavaScript
25 lines
582 B
JavaScript
'use strict';
|
|
|
|
exports.up = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
ALTER TABLE groups ADD COLUMN root_role_id INTEGER DEFAULT NULL;
|
|
ALTER TABLE groups
|
|
ADD CONSTRAINT fk_group_role_id
|
|
FOREIGN KEY(root_role_id)
|
|
REFERENCES roles(id);
|
|
`,
|
|
callback,
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, callback) {
|
|
db.runSql(
|
|
`
|
|
ALTER TABLE groups DROP CONSTRAINT fk_group_role_id;
|
|
ALTER TABLE groups DROP COLUMN root_role_id;
|
|
`,
|
|
callback,
|
|
);
|
|
};
|