unleash-server 4.6.5 → 4.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1266 -0
- package/dist/lib/middleware/no-authentication.js +3 -7
- package/dist/lib/middleware/no-authentication.js.map +1 -1
- package/dist/lib/routes/admin-api/config.js +3 -1
- package/dist/lib/routes/admin-api/config.js.map +1 -1
- package/dist/lib/routes/admin-api/user.js +8 -1
- package/dist/lib/routes/admin-api/user.js.map +1 -1
- package/dist/lib/types/no-auth-user.d.ts +7 -0
- package/dist/lib/types/no-auth-user.js +13 -0
- package/dist/lib/types/no-auth-user.js.map +1 -0
- package/dist/migrations/20210428103922-patch-role-table.d.ts +2 -0
- package/dist/migrations/20210428103922-patch-role-table.js +19 -0
- package/dist/migrations/20210428103922-patch-role-table.js.map +1 -0
- package/dist/migrations/20210428103924-patch-admin-role-name.d.ts +2 -0
- package/dist/migrations/20210428103924-patch-admin-role-name.js +11 -0
- package/dist/migrations/20210428103924-patch-admin-role-name.js.map +1 -0
- package/dist/migrations/20210428103924-patch-admin_role.d.ts +2 -0
- package/dist/migrations/20210428103924-patch-admin_role.js +23 -0
- package/dist/migrations/20210428103924-patch-admin_role.js.map +1 -0
- package/dist/migrations/20210428103924-patch-role_permissions.d.ts +2 -0
- package/dist/migrations/20210428103924-patch-role_permissions.js +50 -0
- package/dist/migrations/20210428103924-patch-role_permissions.js.map +1 -0
- package/package.json +2 -2
|
@@ -3,17 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const api_user_1 = __importDefault(require("../types/api-user"));
|
|
6
|
+
const no_auth_user_1 = __importDefault(require("../types/no-auth-user"));
|
|
8
7
|
function noneAuthentication(basePath = '', app) {
|
|
9
8
|
app.use(`${basePath}/api/admin/`, (req, res, next) => {
|
|
10
9
|
// @ts-ignore
|
|
11
10
|
if (!req.user) {
|
|
12
|
-
// @ts-
|
|
13
|
-
req.user = new
|
|
14
|
-
username: 'unknown',
|
|
15
|
-
permissions: [permissions_1.ADMIN],
|
|
16
|
-
});
|
|
11
|
+
// @ts-expect-error
|
|
12
|
+
req.user = new no_auth_user_1.default();
|
|
17
13
|
}
|
|
18
14
|
next();
|
|
19
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-authentication.js","sourceRoot":"","sources":["../../../src/lib/middleware/no-authentication.ts"],"names":[],"mappings":";;;;;AACA,
|
|
1
|
+
{"version":3,"file":"no-authentication.js","sourceRoot":"","sources":["../../../src/lib/middleware/no-authentication.ts"],"names":[],"mappings":";;;;;AACA,yEAA+C;AAE/C,SAAS,kBAAkB,CAAC,QAAQ,GAAG,EAAE,EAAE,GAAgB;IACvD,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACjD,aAAa;QACb,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;YACX,mBAAmB;YACnB,GAAG,CAAC,IAAI,GAAG,IAAI,sBAAU,EAAE,CAAC;SAC/B;QACD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AACD,kBAAe,kBAAkB,CAAC"}
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const option_1 = require("../../types/option");
|
|
6
7
|
const version_1 = __importDefault(require("../../util/version"));
|
|
7
8
|
const controller_1 = __importDefault(require("../controller"));
|
|
8
9
|
const simple_auth_settings_1 = require("../../types/settings/simple-auth-settings");
|
|
@@ -25,7 +26,8 @@ class ConfigController extends controller_1.default {
|
|
|
25
26
|
const config = this.uiConfig;
|
|
26
27
|
const simpleAuthSettings = await this.settingService.get(simple_auth_settings_1.simpleAuthKey);
|
|
27
28
|
const versionInfo = this.versionService.getVersionInfo();
|
|
28
|
-
const disablePasswordAuth = simpleAuthSettings?.disabled
|
|
29
|
+
const disablePasswordAuth = simpleAuthSettings?.disabled ||
|
|
30
|
+
this.config.authentication.type == option_1.IAuthType.NONE;
|
|
29
31
|
res.json({ ...config, versionInfo, disablePasswordAuth });
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/lib/routes/admin-api/config.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/lib/routes/admin-api/config.ts"],"names":[],"mappings":";;;;;AAEA,+CAA+D;AAC/D,iEAAyC;AAEzC,+DAAuC;AAGvC,oFAGmD;AAEnD,MAAM,gBAAiB,SAAQ,oBAAU;IAOrC,YACI,MAAsB,EACtB,EACI,cAAc,EACd,cAAc,GAC4C;QAE9D,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,MAAM,kBAAkB,GACpB,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG;YACZ,GAAG,MAAM,CAAC,EAAE;YACZ,kBAAkB;YAClB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YACpC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW;YACtC,OAAO,EAAP,iBAAO;SACV,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,GAAY,EAAE,GAAa;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,MAAM,kBAAkB,GACpB,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAqB,oCAAa,CAAC,CAAC;QAErE,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;QACzD,MAAM,mBAAmB,GACrB,kBAAkB,EAAE,QAAQ;YAC5B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,IAAI,kBAAS,CAAC,IAAI,CAAC;QACtD,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAC9D,CAAC;CACJ;AACD,kBAAe,gBAAgB,CAAC"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const controller_1 = __importDefault(require("../controller"));
|
|
7
|
+
const option_1 = require("../../types/option");
|
|
7
8
|
const permissions_1 = require("../../types/permissions");
|
|
8
9
|
class UserController extends controller_1.default {
|
|
9
10
|
constructor(config, { accessService, userService, sessionService, userFeedbackService, userSplashService, }) {
|
|
@@ -20,7 +21,13 @@ class UserController extends controller_1.default {
|
|
|
20
21
|
async getUser(req, res) {
|
|
21
22
|
res.setHeader('cache-control', 'no-store');
|
|
22
23
|
const { user } = req;
|
|
23
|
-
|
|
24
|
+
let permissions;
|
|
25
|
+
if (this.config.authentication.type === option_1.IAuthType.NONE) {
|
|
26
|
+
permissions = [{ permission: permissions_1.ADMIN }];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
permissions = await this.accessService.getPermissionsForUser(user);
|
|
30
|
+
}
|
|
24
31
|
const feedback = await this.userFeedbackService.getAllUserFeedback(user);
|
|
25
32
|
const splash = await this.userSplashService.getAllUserSplashs(user);
|
|
26
33
|
return res
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/lib/routes/admin-api/user.ts"],"names":[],"mappings":";;;;;AAEA,+DAAuC;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/lib/routes/admin-api/user.ts"],"names":[],"mappings":";;;;;AAEA,+DAAuC;AAEvC,+CAA+D;AAM/D,yDAAsD;AAOtD,MAAM,cAAe,SAAQ,oBAAU;IAWnC,YACI,MAAsB,EACtB,EACI,aAAa,EACb,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,iBAAiB,GAQpB;QAED,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAE3C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,cAAc,EAAE,kBAAI,CAAC,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAiB,EAAE,GAAa;QAC1C,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC3C,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACrB,IAAI,WAAW,CAAC;QAChB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,KAAK,kBAAS,CAAC,IAAI,EAAE;YACpD,WAAW,GAAG,CAAC,EAAE,UAAU,EAAE,mBAAK,EAAE,CAAC,CAAC;SACzC;aAAM;YACH,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;SACtE;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAC9D,IAAI,CACP,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEpE,OAAO,GAAG;aACL,MAAM,CAAC,GAAG,CAAC;aACX,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;aAC7C,GAAG,EAAE,CAAC;IACf,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,GAAoD,EACpD,GAAa;QAEb,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACrB,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;QAC/C,IAAI,QAAQ,KAAK,eAAe,EAAE;YAC9B,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC5C,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YACzD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;SACzB;aAAM;YACH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;SACzB;IACL,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAiB,EAAE,GAAa;QAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC;AAChC,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const permissions_1 = require("./permissions");
|
|
4
|
+
class NoAuthUser {
|
|
5
|
+
constructor(username = 'unknown', id = -1, permissions = [permissions_1.ADMIN]) {
|
|
6
|
+
this.isAPI = true;
|
|
7
|
+
this.username = username;
|
|
8
|
+
this.id = id;
|
|
9
|
+
this.permissions = permissions;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.default = NoAuthUser;
|
|
13
|
+
//# sourceMappingURL=no-auth-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-auth-user.js","sourceRoot":"","sources":["../../../src/lib/types/no-auth-user.ts"],"names":[],"mappings":";;AAAA,+CAAsC;AAEtC,MAAqB,UAAU;IAS3B,YACI,WAAmB,SAAS,EAC5B,KAAa,CAAC,CAAC,EACf,cAAwB,CAAC,mBAAK,CAAC;QAE/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;CACJ;AAnBD,6BAmBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const async = require('async');
|
|
3
|
+
function resolveRoleName(permissions) {
|
|
4
|
+
if (!permissions || permissions.length === 0) {
|
|
5
|
+
return 'Viewer';
|
|
6
|
+
}
|
|
7
|
+
if (permissions.includes('ADMIN')) {
|
|
8
|
+
return 'Admin';
|
|
9
|
+
}
|
|
10
|
+
return 'Editor';
|
|
11
|
+
}
|
|
12
|
+
exports.up = function (db, cb) {
|
|
13
|
+
db.runSql('ALTER TABLE roles ADD COLUMN IF NOT EXISTS project text', cb);
|
|
14
|
+
};
|
|
15
|
+
exports.down = function (db, cb) {
|
|
16
|
+
// We can't just remove roles for users as we don't know if there has been any manual additions.
|
|
17
|
+
cb();
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=20210428103922-patch-role-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20210428103922-patch-role-table.js","sourceRoot":"","sources":["../../src/migrations/20210428103922-patch-role-table.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,SAAS,eAAe,CAAC,WAAW;IAChC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1C,OAAO,QAAQ,CAAC;KACnB;IACD,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC/B,OAAO,OAAO,CAAC;KAClB;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,OAAO,CAAC,EAAE,GAAG,UAAU,EAAE,EAAE,EAAE;IACzB,EAAE,CAAC,MAAM,CACL,yDAAyD,EAAE,EAAE,CAChE,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,CAAC,IAAI,GAAG,UAAU,EAAE,EAAE,EAAE;IAC3B,gGAAgG;IAChG,EAAE,EAAE,CAAC;AACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
exports.up = function (db, cb) {
|
|
3
|
+
db.runSql(`
|
|
4
|
+
UPDATE roles set name='Admin' where name='Super User';
|
|
5
|
+
`, cb);
|
|
6
|
+
};
|
|
7
|
+
exports.down = function (db, cb) {
|
|
8
|
+
// We can't just remove roles for users as we don't know if there has been any manual additions.
|
|
9
|
+
cb();
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=20210428103924-patch-admin-role-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20210428103924-patch-admin-role-name.js","sourceRoot":"","sources":["../../src/migrations/20210428103924-patch-admin-role-name.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,CAAC,EAAE,GAAG,UAAU,EAAE,EAAE,EAAE;IACzB,EAAE,CAAC,MAAM,CACL;;SAEC,EACD,EAAE,CACL,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,CAAC,IAAI,GAAG,UAAU,EAAE,EAAE,EAAE;IAC3B,gGAAgG;IAChG,EAAE,EAAE,CAAC;AACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
exports.up = function (db, cb) {
|
|
3
|
+
db.runSql(`
|
|
4
|
+
DO $$
|
|
5
|
+
declare
|
|
6
|
+
begin
|
|
7
|
+
WITH admin AS (
|
|
8
|
+
SELECT * FROM roles WHERE name in ('Admin', 'Super User') LIMIT 1
|
|
9
|
+
)
|
|
10
|
+
INSERT into role_user(role_id, user_id)
|
|
11
|
+
VALUES
|
|
12
|
+
((select id from admin), (select id FROM users where username='admin' LIMIT 1));
|
|
13
|
+
|
|
14
|
+
EXCEPTION WHEN OTHERS THEN
|
|
15
|
+
raise notice 'Ignored';
|
|
16
|
+
end;
|
|
17
|
+
$$;`, cb);
|
|
18
|
+
};
|
|
19
|
+
exports.down = function (db, cb) {
|
|
20
|
+
// We can't just remove roles for users as we don't know if there has been any manual additions.
|
|
21
|
+
cb();
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=20210428103924-patch-admin_role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20210428103924-patch-admin_role.js","sourceRoot":"","sources":["../../src/migrations/20210428103924-patch-admin_role.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,CAAC,EAAE,GAAG,UAAU,EAAE,EAAE,EAAE;IACzB,EAAE,CAAC,MAAM,CACL;;;;;;;;;;;;;;YAcI,EACJ,EAAE,CACL,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,CAAC,IAAI,GAAG,UAAU,EAAE,EAAE,EAAE;IAC3B,gGAAgG;IAChG,EAAE,EAAE,CAAC;AACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
exports.up = function (db, cb) {
|
|
3
|
+
db.runSql(`
|
|
4
|
+
DO $$
|
|
5
|
+
declare
|
|
6
|
+
begin
|
|
7
|
+
WITH editor AS (
|
|
8
|
+
SELECT * FROM roles WHERE name in ('Editor', 'Regular') LIMIT 1
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
INSERT INTO role_permission(role_id, project, permission)
|
|
12
|
+
VALUES
|
|
13
|
+
((SELECT id from editor), '', 'CREATE_STRATEGY'),
|
|
14
|
+
((SELECT id from editor), '', 'UPDATE_STRATEGY'),
|
|
15
|
+
((SELECT id from editor), '', 'DELETE_STRATEGY'),
|
|
16
|
+
|
|
17
|
+
((SELECT id from editor), '', 'UPDATE_APPLICATION'),
|
|
18
|
+
|
|
19
|
+
((SELECT id from editor), '', 'CREATE_CONTEXT_FIELD'),
|
|
20
|
+
((SELECT id from editor), '', 'UPDATE_CONTEXT_FIELD'),
|
|
21
|
+
((SELECT id from editor), '', 'DELETE_CONTEXT_FIELD'),
|
|
22
|
+
|
|
23
|
+
((SELECT id from editor), '', 'CREATE_PROJECT'),
|
|
24
|
+
|
|
25
|
+
((SELECT id from editor), '', 'CREATE_ADDON'),
|
|
26
|
+
((SELECT id from editor), '', 'UPDATE_ADDON'),
|
|
27
|
+
((SELECT id from editor), '', 'DELETE_ADDON'),
|
|
28
|
+
|
|
29
|
+
((SELECT id from editor), 'default', 'UPDATE_PROJECT'),
|
|
30
|
+
((SELECT id from editor), 'default', 'DELETE_PROJECT'),
|
|
31
|
+
((SELECT id from editor), 'default', 'CREATE_FEATURE'),
|
|
32
|
+
((SELECT id from editor), 'default', 'UPDATE_FEATURE'),
|
|
33
|
+
((SELECT id from editor), 'default', 'DELETE_FEATURE');
|
|
34
|
+
|
|
35
|
+
-- Clean up duplicates
|
|
36
|
+
DELETE FROM role_permission p1
|
|
37
|
+
USING role_permission p2
|
|
38
|
+
WHERE p1.created_at < p2.created_at -- select the "older" ones
|
|
39
|
+
AND p1.project = p2.project -- list columns that define duplicates
|
|
40
|
+
AND p1.permission = p2.permission;
|
|
41
|
+
EXCEPTION WHEN OTHERS THEN
|
|
42
|
+
raise notice 'Ignored';
|
|
43
|
+
end;
|
|
44
|
+
$$;`, cb);
|
|
45
|
+
};
|
|
46
|
+
exports.down = function (db, cb) {
|
|
47
|
+
// We can't just remove roles for users as we don't know if there has been any manual additions.
|
|
48
|
+
cb();
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=20210428103924-patch-role_permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20210428103924-patch-role_permissions.js","sourceRoot":"","sources":["../../src/migrations/20210428103924-patch-role_permissions.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,CAAC,EAAE,GAAG,UAAU,EAAE,EAAE,EAAE;IACzB,EAAE,CAAC,MAAM,CACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAyCI,EACJ,EAAE,CACL,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,CAAC,IAAI,GAAG,UAAU,EAAE,EAAE,EAAE;IAC3B,gGAAgG;IAChG,EAAE,EAAE,CAAC;AACT,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unleash-server",
|
|
3
3
|
"description": "Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.",
|
|
4
|
-
"version": "4.6.
|
|
4
|
+
"version": "4.6.8",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unleash",
|
|
7
7
|
"feature toggle",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"serve-favicon": "^2.5.0",
|
|
113
113
|
"stoppable": "^1.1.0",
|
|
114
114
|
"type-is": "^1.6.18",
|
|
115
|
-
"unleash-frontend": "4.6.
|
|
115
|
+
"unleash-frontend": "4.6.5",
|
|
116
116
|
"uuid": "^8.3.2"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|