Skip to content

Commit df4842a

Browse files
authored
Merge pull request #115 from TaskarCenterAtUW/feature-1504
Removing tdei_user role from system as it is replaced by member role
2 parents 093791f + 270e146 commit df4842a

File tree

5 files changed

+58
-7
lines changed

5 files changed

+58
-7
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use strict';
2+
3+
var dbm;
4+
var type;
5+
var seed;
6+
var fs = require('fs');
7+
var path = require('path');
8+
var Promise;
9+
10+
/**
11+
* We receive the dbmigrate dependency from dbmigrate initially.
12+
* This enables us to not have to rely on NODE_PATH.
13+
*/
14+
exports.setup = function(options, seedLink) {
15+
dbm = options.dbmigrate;
16+
type = dbm.dataType;
17+
seed = seedLink;
18+
Promise = options.Promise;
19+
};
20+
21+
exports.up = function(db) {
22+
var filePath = path.join(__dirname, 'sqls', '20250214074240-tdei-user-role-deletion-up.sql');
23+
return new Promise( function( resolve, reject ) {
24+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
25+
if (err) return reject(err);
26+
console.log('received data: ' + data);
27+
28+
resolve(data);
29+
});
30+
})
31+
.then(function(data) {
32+
return db.runSql(data);
33+
});
34+
};
35+
36+
exports.down = function(db) {
37+
var filePath = path.join(__dirname, 'sqls', '20250214074240-tdei-user-role-deletion-down.sql');
38+
return new Promise( function( resolve, reject ) {
39+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40+
if (err) return reject(err);
41+
console.log('received data: ' + data);
42+
43+
resolve(data);
44+
});
45+
})
46+
.then(function(data) {
47+
return db.runSql(data);
48+
});
49+
};
50+
51+
exports._meta = {
52+
"version": 1
53+
};

db-management/migrations/sqls/20240430101231-init-up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ VALUES
108108
('flex_data_generator', 'Flex Data generator can publish dataset for the project group'),
109109
('tdei_admin', 'TDEI super admin'),
110110
('poc', 'Point of contact of project group'),
111-
('tdei_user', 'User of the TDEI system'),
111+
('member', 'User of the TDEI system'),
112112
('pathways_data_generator', 'Pathways Data generator can publish dataset for the project group'),
113113
('osw_data_generator', 'OSW Data generator can publish dataset for the project group');
114114

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Replace with your SQL commands */
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE from public.role_permission where role_id IN (SELECT role_id FROM public.roles WHERE name = 'tdei_user');
2+
DELETE FROM public.user_roles WHERE role_id IN (SELECT role_id FROM public.roles WHERE name = 'tdei_user');
3+
DELETE FROM public.roles WHERE name = 'tdei_user';

src/constants/role-id-constants.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)