@things-factory/board-service 10.1.104 → 10.1.107
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/dist-server/index.js
CHANGED
|
@@ -16,8 +16,8 @@ function initMiddlewares(app) {
|
|
|
16
16
|
.split(',')
|
|
17
17
|
.map(p => p.trim());
|
|
18
18
|
const prohibited = !licensedPermissions.includes('Modeller') && [
|
|
19
|
-
{ privilege: 'mutation', category: 'board' },
|
|
20
|
-
{ privilege: 'mutation', category: 'board-template' }
|
|
19
|
+
{ privilege: 'mutation', category: 'board', by: 'license' },
|
|
20
|
+
{ privilege: 'mutation', category: 'board-template', by: 'license' }
|
|
21
21
|
];
|
|
22
22
|
app.use(async (context, next) => {
|
|
23
23
|
if (prohibited) {
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;AAoBA,0CAiBC;;AArCD,6DAAkC;AAClC,gEAAqC;AACrC,iEAAsC;AAEtC,uBAAoB;AAGpB,qFAAuE;AASvE;;;GAGG;AACH,SAAgB,eAAe,CAAC,GAAQ;IACtC,MAAM,mBAAmB,GAAG,CAAC,IAAA,uCAAa,EAAC,6BAA6B,CAAC,IAAI,kBAAkB,CAAC;SAC7F,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IAErB,MAAM,UAAU,GAAkC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI;QAC7F,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE;QAC3D,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAAE,SAAS,EAAE;KACrE,CAAA;IAED,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,QAAQ,GAA0B,OAAO,CAAC,KAAK,CAAC,oBAAoB,IAAI,EAAE,CAAA;YAChF,OAAO,CAAC,KAAK,CAAC,oBAAoB,GAAG,CAAC,GAAG,QAAQ,EAAE,GAAG,UAAU,CAAC,CAAA;QACnE,CAAC;QACD,MAAM,IAAI,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["export * from './service/index.js'\nexport * from './migrations/index.js'\nexport * from './controllers/index.js'\n\nimport './routes.js'\n\nimport Koa from 'koa'\nimport { getPermission } from '@things-factory/operato-license-checker'\n\ninterface ProhibitedPrivilege {\n privilege: string\n category: string\n /* Who refused it - the license, so the refusal does not offer an access request (ADR-0103 decision 1). */\n by?: 'address' | 'license'\n}\n\n/**\n * Board 서비스 미들웨어 초기화.\n * 라이선스 권한에 따라 board/board-template mutation을 제한한다.\n */\nexport function initMiddlewares(app: Koa) {\n const licensedPermissions = (getPermission('Permissions For Board Usage') || 'Modeller, Viewer')\n .split(',')\n .map(p => p.trim())\n\n const prohibited: ProhibitedPrivilege[] | false = !licensedPermissions.includes('Modeller') && [\n { privilege: 'mutation', category: 'board', by: 'license' },\n { privilege: 'mutation', category: 'board-template', by: 'license' }\n ]\n\n app.use(async (context, next) => {\n if (prohibited) {\n const existing: ProhibitedPrivilege[] = context.state.prohibitedPrivileges || []\n context.state.prohibitedPrivileges = [...existing, ...prohibited]\n }\n await next()\n })\n}\n"]}
|