mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: editor can add dependencies in default project (#8077)
This commit is contained in:
parent
f41a688edb
commit
d220aaec0f
@ -0,0 +1,28 @@
|
||||
exports.up = function (db, cb) {
|
||||
db.runSql(
|
||||
`
|
||||
INSERT INTO role_permission (role_id, permission)
|
||||
SELECT id, 'UPDATE_FEATURE_DEPENDENCY'
|
||||
FROM roles WHERE name = 'Editor' AND type = 'root'
|
||||
AND EXISTS (SELECT 1 FROM roles WHERE name = 'Editor' and type = 'root')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM role_permission
|
||||
WHERE role_permission.role_id = (SELECT id FROM roles WHERE name = 'Editor' AND type = 'root')
|
||||
AND role_permission.permission = 'UPDATE_FEATURE_DEPENDENCY'
|
||||
);
|
||||
`,
|
||||
cb
|
||||
);
|
||||
};
|
||||
|
||||
exports.down = function (db, cb) {
|
||||
db.runSql(
|
||||
`
|
||||
DELETE FROM role_permission
|
||||
WHERE role_id = (SELECT id FROM roles WHERE name = 'Editor' AND type = 'root')
|
||||
AND permission = 'UPDATE_FEATURE_DEPENDENCY';
|
||||
`,
|
||||
cb
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user