mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
88004a6138
https://linear.app/unleash/issue/2-530/api-allow-creation-of-pats-for-other-users ![image](https://user-images.githubusercontent.com/14320932/208720680-5d5ccee7-1972-4f5b-8024-3a69d50a571f.png) Adds and takes into account the following permissions: - **READ_USER_PAT**; - **CREATE_USER_PAT**; - **DELETE_USER_PAT**; API only, will make some exploration on UI soon. Co-authored-by: Gastón Fournier <gaston@getunleash.ai>
22 lines
793 B
JavaScript
22 lines
793 B
JavaScript
exports.up = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
INSERT INTO permissions (permission, display_name, type) VALUES ('READ_USER_PAT', 'Read PATs for a specific user', 'root');
|
|
INSERT INTO permissions (permission, display_name, type) VALUES ('CREATE_USER_PAT', 'Create a PAT for a specific user', 'root');
|
|
INSERT INTO permissions (permission, display_name, type) VALUES ('DELETE_USER_PAT', 'Delete a PAT for a specific user', 'root');
|
|
`,
|
|
cb,
|
|
);
|
|
};
|
|
|
|
exports.down = function (db, cb) {
|
|
db.runSql(
|
|
`
|
|
DELETE FROM permissions WHERE permission = 'READ_USER_PAT';
|
|
DELETE FROM permissions WHERE permission = 'CREATE_USER_PAT';
|
|
DELETE FROM permissions WHERE permission = 'DELETE_USER_PAT';
|
|
`,
|
|
cb,
|
|
);
|
|
};
|