-
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add in missing create/delete tag permissions
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
exports.up = function (db, cb) { | ||
db.runSql( | ||
` | ||
INSERT INTO permissions (permission, display_name, type) VALUES ('CREATE_TAG', 'Add tags to toggles', 'project'); | ||
INSERT INTO permissions (permission, display_name, type) VALUES ('DELETE_TAG', 'Remove tags from toggles', 'project'); | ||
INSERT INTO role_permission (role_id, permission_id, environment) | ||
SELECT | ||
(SELECT id as role_id from roles WHERE name = 'Editor' LIMIT 1), | ||
p.id as permission_id, | ||
'' as environment | ||
FROM permissions p | ||
WHERE p.permission IN | ||
('CREATE_TAG', | ||
'DELETE_TAG'); | ||
INSERT INTO role_permission (role_id, permission_id, environment) | ||
SELECT | ||
(SELECT id as role_id from roles WHERE name = 'Owner' LIMIT 1), | ||
p.id as permission_id, | ||
'' as environment | ||
FROM permissions p | ||
WHERE p.permission IN | ||
('CREATE_TAG', | ||
'DELETE_TAG'); | ||
`, | ||
cb, | ||
); | ||
}; | ||
|
||
exports.down = function (db, cb) { | ||
cb(); | ||
}; |