-
-
Notifications
You must be signed in to change notification settings - Fork 734
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added more granular project permissions
- Loading branch information
Showing
2 changed files
with
34 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
26 changes: 26 additions & 0 deletions
26
src/migrations/20240117093601-add-more-granular-project-permissions.js
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,26 @@ | ||
exports.up = function(db, cb) { | ||
db.runSql(` | ||
INSERT INTO permissions(permission, display_name, type) VALUES | ||
('PROJECT_USER_ACCESS_READ', 'View only access to Project User Access', 'project'), | ||
('PROJECT_DEFAULT_STRATEGY_READ', 'View only access to default strategy configuration for project', 'project'), | ||
('PROJECT_CHANGE_REQUEST_READ', 'View only access to change request configuration for project', 'project'), | ||
('PROJECT_SETTINGS_READ', 'View only access to project settings', 'project'), | ||
('PROJECT_USER_ACCESS_WRITE', 'Write access to Project User Access', 'project'), | ||
('PROJECT_DEFAULT_STRATEGY_WRITE', 'Write access to default strategy configuration for project', 'project'), | ||
('PROJECT_CHANGE_REQUEST_WRITE', 'Write access to change request configuration for project', 'project'), | ||
('PROJECT_SETTINGS_WRITE', 'Write access to project settings', 'project'); | ||
`, cb); | ||
}; | ||
|
||
exports.down = function(db, cb) { | ||
db.runSql(` | ||
DELETE FROM permissions WHERE permission IN ('PROJECT_USER_ACCESS_READ', | ||
'PROJECT_DEFAULT_STRATEGY_READ', | ||
'PROJECT_CHANGE_REQUEST_READ', | ||
'PROJECT_SETTINGS_READ', | ||
'PROJECT_USER_ACCESS_WRITE', | ||
'PROJECT_DEFAULT_STRATEGY_WRITE', | ||
'PROJECT_CHANGE_REQUEST_WRITE', | ||
'PROJECT_SETTINGS_WRITE'); | ||
`, cb); | ||
}; |