emilsoftware-utilities 2.0.0-dev.60 → 2.0.0-dev.62
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/accessi-module/AccessiModule.d.ts +6 -0
- package/dist/accessi-module/AccessiModule.js.map +1 -1
- package/dist/accessi-module/Console/console.js +163 -4
- package/dist/accessi-module/Console/console.js.map +1 -1
- package/dist/accessi-module/Console/generated/accessiApi.d.ts +68 -5
- package/dist/accessi-module/Console/generated/accessiApi.js +84 -10
- package/dist/accessi-module/Console/generated/accessiApi.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/createScopeRequest.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/createScopeRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createScopeRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.d.ts +4 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/getMenuScopesResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getMenuScopesResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getMenuScopesResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getMenusParams.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/getMenusParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/getMenusParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getScopesResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getScopesResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getScopesResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUserRolesAndGrantsParams.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/getUserRolesAndGrantsParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/getUserRolesAndGrantsParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/index.d.ts +9 -0
- package/dist/accessi-module/Console/generated/model/index.js +9 -0
- package/dist/accessi-module/Console/generated/model/index.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/loginRequest.d.ts +2 -0
- package/dist/accessi-module/Console/generated/model/loginRequest.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/scopeEntity.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/scopeEntity.js +9 -0
- package/dist/accessi-module/Console/generated/model/scopeEntity.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/setMenuScopesRequest.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/setMenuScopesRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/setMenuScopesRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/setScopeMenusRequest.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/setScopeMenusRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/setScopeMenusRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateScopeRequest.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/updateScopeRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateScopeRequest.js.map +1 -0
- package/dist/accessi-module/Console/index.html +1 -0
- package/dist/accessi-module/Controllers/PermissionController.d.ts +11 -3
- package/dist/accessi-module/Controllers/PermissionController.js +208 -12
- package/dist/accessi-module/Controllers/PermissionController.js.map +1 -1
- package/dist/accessi-module/Dtos/LoginRequest.d.ts +2 -0
- package/dist/accessi-module/Dtos/LoginRequest.js +10 -0
- package/dist/accessi-module/Dtos/LoginRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/ScopeDtos.d.ts +28 -0
- package/dist/accessi-module/Dtos/ScopeDtos.js +103 -0
- package/dist/accessi-module/Dtos/ScopeDtos.js.map +1 -0
- package/dist/accessi-module/Dtos/index.d.ts +1 -0
- package/dist/accessi-module/Dtos/index.js +1 -0
- package/dist/accessi-module/Dtos/index.js.map +1 -1
- package/dist/accessi-module/Services/AuthService/AuthService.d.ts +1 -1
- package/dist/accessi-module/Services/AuthService/AuthService.js +3 -3
- package/dist/accessi-module/Services/AuthService/AuthService.js.map +1 -1
- package/dist/accessi-module/Services/PermissionService/PermissionService.d.ts +27 -4
- package/dist/accessi-module/Services/PermissionService/PermissionService.js +177 -24
- package/dist/accessi-module/Services/PermissionService/PermissionService.js.map +1 -1
- package/dist/accessi-module/Services/UserService/UserService.d.ts +1 -0
- package/dist/accessi-module/Services/UserService/UserService.js +1 -1
- package/dist/accessi-module/Services/UserService/UserService.js.map +1 -1
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js +2 -0
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js.map +1 -1
- package/dist/accessi-module/database-updates/accessiSchema.d.ts +1 -1
- package/dist/accessi-module/database-updates/accessiSchema.js +12 -1
- package/dist/accessi-module/database-updates/accessiSchema.js.map +1 -1
- package/dist/accessi-module/database-updates/menuScopeSeed.d.ts +15 -0
- package/dist/accessi-module/database-updates/menuScopeSeed.js +338 -0
- package/dist/accessi-module/database-updates/menuScopeSeed.js.map +1 -0
- package/dist/accessi-module/database-updates/menuScopeSeeder.d.ts +8 -0
- package/dist/accessi-module/database-updates/menuScopeSeeder.js +131 -0
- package/dist/accessi-module/database-updates/menuScopeSeeder.js.map +1 -0
- package/dist/accessi-module/database-updates/runAccessiDbUpdate.js +4 -1
- package/dist/accessi-module/database-updates/runAccessiDbUpdate.js.map +1 -1
- package/dist/emilsoftware-utilities-2.0.0-dev.62.tgz +0 -0
- package/package.json +3 -3
- package/dist/emilsoftware-utilities-2.0.0-dev.60.tgz +0 -0
|
@@ -29,6 +29,7 @@ const Utilities_1 = require("../../Utilities");
|
|
|
29
29
|
const BaseResponse_1 = require("../Dtos/BaseResponse");
|
|
30
30
|
const AssignPermissionsToUserRequest_1 = require("../Dtos/AssignPermissionsToUserRequest");
|
|
31
31
|
const AssignRolesToUserRequest_1 = require("../Dtos/AssignRolesToUserRequest");
|
|
32
|
+
const ScopeDtos_1 = require("../Dtos/ScopeDtos");
|
|
32
33
|
const CatalogDtos_1 = require("../Dtos/CatalogDtos");
|
|
33
34
|
const GetGroupsWithMenusResponse_1 = require("../Dtos/GetGroupsWithMenusResponse");
|
|
34
35
|
const GetMenusResponse_1 = require("../Dtos/GetMenusResponse");
|
|
@@ -156,10 +157,10 @@ let PermissionController = PermissionController_1 = class PermissionController {
|
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
|
-
getMenus(res) {
|
|
160
|
+
getMenus(scope, res) {
|
|
160
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
162
|
try {
|
|
162
|
-
const menus = yield this.permissionService.getMenus();
|
|
163
|
+
const menus = yield this.permissionService.getMenus(scope);
|
|
163
164
|
return Utilities_1.RestUtilities.sendBaseResponse(res, menus);
|
|
164
165
|
}
|
|
165
166
|
catch (error) {
|
|
@@ -167,13 +168,13 @@ let PermissionController = PermissionController_1 = class PermissionController {
|
|
|
167
168
|
}
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
|
-
getGroupsWithMenus(includeDisabled, res) {
|
|
171
|
+
getGroupsWithMenus(includeDisabled, scope, res) {
|
|
171
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
173
|
try {
|
|
173
174
|
const includeDisabledFlag = typeof includeDisabled === 'string'
|
|
174
175
|
? ['true', '1', 'yes'].includes(includeDisabled.toLowerCase())
|
|
175
176
|
: false;
|
|
176
|
-
const menus = yield this.permissionService.getGroupsWithMenus(includeDisabledFlag);
|
|
177
|
+
const menus = yield this.permissionService.getGroupsWithMenus(includeDisabledFlag, scope);
|
|
177
178
|
return Utilities_1.RestUtilities.sendBaseResponse(res, menus);
|
|
178
179
|
}
|
|
179
180
|
catch (error) {
|
|
@@ -303,7 +304,7 @@ let PermissionController = PermissionController_1 = class PermissionController {
|
|
|
303
304
|
}
|
|
304
305
|
});
|
|
305
306
|
}
|
|
306
|
-
getUserRolesAndGrants(request, codiceUtente, res) {
|
|
307
|
+
getUserRolesAndGrants(request, codiceUtente, scope, res) {
|
|
307
308
|
return __awaiter(this, void 0, void 0, function* () {
|
|
308
309
|
try {
|
|
309
310
|
const authenticatedUser = (0, accessControl_1.getAuthenticatedAccessiUser)(request);
|
|
@@ -313,7 +314,7 @@ let PermissionController = PermissionController_1 = class PermissionController {
|
|
|
313
314
|
// gerarchia ADMIN > SUPER applicata alle operazioni di scrittura.
|
|
314
315
|
yield this.ensureManageableTarget(authenticatedUser, codiceUtente);
|
|
315
316
|
}
|
|
316
|
-
const menus = yield this.permissionService.getUserRolesAndGrants(codiceUtente);
|
|
317
|
+
const menus = yield this.permissionService.getUserRolesAndGrants(codiceUtente, scope);
|
|
317
318
|
return Utilities_1.RestUtilities.sendBaseResponse(res, menus);
|
|
318
319
|
}
|
|
319
320
|
catch (error) {
|
|
@@ -321,6 +322,91 @@ let PermissionController = PermissionController_1 = class PermissionController {
|
|
|
321
322
|
}
|
|
322
323
|
});
|
|
323
324
|
}
|
|
325
|
+
// -------------------------------------------------------------------------
|
|
326
|
+
// Scope applicativi: catalogo e associazioni menu/scope.
|
|
327
|
+
// -------------------------------------------------------------------------
|
|
328
|
+
getScopes(res) {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
330
|
+
try {
|
|
331
|
+
const scopes = yield this.permissionService.getScopes();
|
|
332
|
+
return Utilities_1.RestUtilities.sendBaseResponse(res, scopes);
|
|
333
|
+
}
|
|
334
|
+
catch (error) {
|
|
335
|
+
return this.sendControllerError(res, error);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
createScope(request, body, res) {
|
|
340
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
+
try {
|
|
342
|
+
(0, accessControl_1.ensureAdmin)((0, accessControl_1.getAuthenticatedAccessiUser)(request), 'Solo gli amministratori possono creare scope.');
|
|
343
|
+
yield this.permissionService.createScope(body);
|
|
344
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `Lo scope ${body.codice} e stato creato con successo.`, common_1.HttpStatus.CREATED);
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
return this.sendControllerError(res, error);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
updateScope(request, codiceScope, body, res) {
|
|
352
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
353
|
+
try {
|
|
354
|
+
(0, accessControl_1.ensureAdmin)((0, accessControl_1.getAuthenticatedAccessiUser)(request), 'Solo gli amministratori possono modificare scope.');
|
|
355
|
+
yield this.permissionService.updateScope(codiceScope, body);
|
|
356
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `Lo scope ${codiceScope} e stato aggiornato con successo.`);
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
return this.sendControllerError(res, error);
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
deleteScope(request, codiceScope, res) {
|
|
364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
365
|
+
try {
|
|
366
|
+
(0, accessControl_1.ensureAdmin)((0, accessControl_1.getAuthenticatedAccessiUser)(request), 'Solo gli amministratori possono eliminare scope.');
|
|
367
|
+
yield this.permissionService.deleteScope(codiceScope);
|
|
368
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `Lo scope ${codiceScope} e stato eliminato con successo.`);
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
return this.sendControllerError(res, error);
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
getMenuScopes(codiceMenu, res) {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
+
try {
|
|
378
|
+
const scopes = yield this.permissionService.getMenuScopes(codiceMenu);
|
|
379
|
+
return Utilities_1.RestUtilities.sendBaseResponse(res, scopes);
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
return this.sendControllerError(res, error);
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
setMenuScopes(request, codiceMenu, body, res) {
|
|
387
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
388
|
+
try {
|
|
389
|
+
(0, accessControl_1.ensureAdmin)((0, accessControl_1.getAuthenticatedAccessiUser)(request), 'Solo gli amministratori possono modificare gli scope.');
|
|
390
|
+
yield this.permissionService.setMenuScopes(codiceMenu, body.scopes);
|
|
391
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `Scope del menu ${codiceMenu} aggiornati con successo.`);
|
|
392
|
+
}
|
|
393
|
+
catch (error) {
|
|
394
|
+
return this.sendControllerError(res, error);
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
setScopeMenus(request, codiceScope, body, res) {
|
|
399
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
400
|
+
try {
|
|
401
|
+
(0, accessControl_1.ensureAdmin)((0, accessControl_1.getAuthenticatedAccessiUser)(request), 'Solo gli amministratori possono modificare gli scope.');
|
|
402
|
+
yield this.permissionService.setScopeMenus(codiceScope, body.menu);
|
|
403
|
+
return Utilities_1.RestUtilities.sendOKMessage(res, `Menu dello scope ${codiceScope} aggiornati con successo.`);
|
|
404
|
+
}
|
|
405
|
+
catch (error) {
|
|
406
|
+
return this.sendControllerError(res, error);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
}
|
|
324
410
|
};
|
|
325
411
|
exports.PermissionController = PermissionController;
|
|
326
412
|
__decorate([
|
|
@@ -462,10 +548,17 @@ __decorate([
|
|
|
462
548
|
(0, swagger_1.ApiOkResponse)({ description: 'Elenco menu', type: GetMenusResponse_1.GetMenusResponse }),
|
|
463
549
|
(0, swagger_1.ApiResponse)({ status: 200, description: 'Lista dei menu recuperata con successo', type: GetMenusResponse_1.GetMenusResponse }),
|
|
464
550
|
(0, swagger_1.ApiResponse)({ status: 500, description: 'Errore interno del server', type: BaseResponse_1.ErrorResponse }),
|
|
551
|
+
(0, swagger_1.ApiQuery)({
|
|
552
|
+
name: 'scope',
|
|
553
|
+
required: false,
|
|
554
|
+
type: String,
|
|
555
|
+
description: 'Filtra per scope applicativi (CSV, es. STEX,TINTEMIX). Assente = tutti.',
|
|
556
|
+
}),
|
|
465
557
|
(0, common_1.Get)('menus'),
|
|
466
|
-
__param(0, (0, common_1.
|
|
558
|
+
__param(0, (0, common_1.Query)('scope')),
|
|
559
|
+
__param(1, (0, common_1.Res)()),
|
|
467
560
|
__metadata("design:type", Function),
|
|
468
|
-
__metadata("design:paramtypes", [Object]),
|
|
561
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
469
562
|
__metadata("design:returntype", Promise)
|
|
470
563
|
], PermissionController.prototype, "getMenus", null);
|
|
471
564
|
__decorate([
|
|
@@ -485,11 +578,18 @@ __decorate([
|
|
|
485
578
|
type: Boolean,
|
|
486
579
|
description: 'Quando true ritorna anche i menu e gruppi disabilitati.',
|
|
487
580
|
}),
|
|
581
|
+
(0, swagger_1.ApiQuery)({
|
|
582
|
+
name: 'scope',
|
|
583
|
+
required: false,
|
|
584
|
+
type: String,
|
|
585
|
+
description: 'Filtra per scope applicativi (CSV, es. STEX,TINTEMIX). Assente = tutti.',
|
|
586
|
+
}),
|
|
488
587
|
(0, common_1.Get)('groups-with-menus'),
|
|
489
588
|
__param(0, (0, common_1.Query)('includeDisabled')),
|
|
490
|
-
__param(1, (0, common_1.
|
|
589
|
+
__param(1, (0, common_1.Query)('scope')),
|
|
590
|
+
__param(2, (0, common_1.Res)()),
|
|
491
591
|
__metadata("design:type", Function),
|
|
492
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
592
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
493
593
|
__metadata("design:returntype", Promise)
|
|
494
594
|
], PermissionController.prototype, "getGroupsWithMenus", null);
|
|
495
595
|
__decorate([
|
|
@@ -642,14 +742,110 @@ __decorate([
|
|
|
642
742
|
(0, swagger_1.ApiOkResponse)({ description: 'Elenco grant utente', type: UserGrantsResponse_1.UserGrantsResponse }),
|
|
643
743
|
(0, swagger_1.ApiResponse)({ status: 200, description: 'Grant utente recuperati con successo', type: UserGrantsResponse_1.UserGrantsResponse }),
|
|
644
744
|
(0, swagger_1.ApiResponse)({ status: 500, description: 'Errore interno del server', type: BaseResponse_1.ErrorResponse }),
|
|
745
|
+
(0, swagger_1.ApiQuery)({
|
|
746
|
+
name: 'scope',
|
|
747
|
+
required: false,
|
|
748
|
+
type: String,
|
|
749
|
+
description: 'Filtra i grant per scope applicativi (CSV). Assente = tutti.',
|
|
750
|
+
}),
|
|
645
751
|
(0, common_1.Get)('grants/:codiceUtente'),
|
|
646
752
|
__param(0, (0, common_1.Req)()),
|
|
647
753
|
__param(1, (0, common_1.Param)('codiceUtente', common_1.ParseIntPipe)),
|
|
648
|
-
__param(2, (0, common_1.
|
|
754
|
+
__param(2, (0, common_1.Query)('scope')),
|
|
755
|
+
__param(3, (0, common_1.Res)()),
|
|
649
756
|
__metadata("design:type", Function),
|
|
650
|
-
__metadata("design:paramtypes", [Object, Number, Object]),
|
|
757
|
+
__metadata("design:paramtypes", [Object, Number, String, Object]),
|
|
651
758
|
__metadata("design:returntype", Promise)
|
|
652
759
|
], PermissionController.prototype, "getUserRolesAndGrants", null);
|
|
760
|
+
__decorate([
|
|
761
|
+
(0, swagger_1.ApiOperation)({ summary: 'Recupera il catalogo degli scope applicativi', operationId: 'getScopes' }),
|
|
762
|
+
(0, swagger_1.ApiOkResponse)({ description: 'Elenco degli scope', type: ScopeDtos_1.GetScopesResponse }),
|
|
763
|
+
(0, swagger_1.ApiResponse)({ status: 500, description: 'Errore interno del server', type: BaseResponse_1.ErrorResponse }),
|
|
764
|
+
(0, common_1.Get)('scopes'),
|
|
765
|
+
__param(0, (0, common_1.Res)()),
|
|
766
|
+
__metadata("design:type", Function),
|
|
767
|
+
__metadata("design:paramtypes", [Object]),
|
|
768
|
+
__metadata("design:returntype", Promise)
|
|
769
|
+
], PermissionController.prototype, "getScopes", null);
|
|
770
|
+
__decorate([
|
|
771
|
+
(0, swagger_1.ApiOperation)({ summary: 'Crea uno scope applicativo', operationId: 'createScope' }),
|
|
772
|
+
(0, swagger_1.ApiBody)({ type: ScopeDtos_1.CreateScopeRequest }),
|
|
773
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'Scope creato', type: BaseResponse_1.ActionResponse }),
|
|
774
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: 'Dati non validi', type: BaseResponse_1.ErrorResponse }),
|
|
775
|
+
(0, common_1.Post)('scopes'),
|
|
776
|
+
__param(0, (0, common_1.Req)()),
|
|
777
|
+
__param(1, (0, common_1.Body)()),
|
|
778
|
+
__param(2, (0, common_1.Res)()),
|
|
779
|
+
__metadata("design:type", Function),
|
|
780
|
+
__metadata("design:paramtypes", [Object, ScopeDtos_1.CreateScopeRequest, Object]),
|
|
781
|
+
__metadata("design:returntype", Promise)
|
|
782
|
+
], PermissionController.prototype, "createScope", null);
|
|
783
|
+
__decorate([
|
|
784
|
+
(0, swagger_1.ApiOperation)({ summary: 'Aggiorna uno scope applicativo', operationId: 'updateScope' }),
|
|
785
|
+
(0, swagger_1.ApiParam)({ name: 'codiceScope', description: 'Codice dello scope', required: true }),
|
|
786
|
+
(0, swagger_1.ApiBody)({ type: ScopeDtos_1.UpdateScopeRequest }),
|
|
787
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Scope aggiornato', type: BaseResponse_1.ActionResponse }),
|
|
788
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: 'Dati non validi', type: BaseResponse_1.ErrorResponse }),
|
|
789
|
+
(0, common_1.Put)('scopes/:codiceScope'),
|
|
790
|
+
__param(0, (0, common_1.Req)()),
|
|
791
|
+
__param(1, (0, common_1.Param)('codiceScope')),
|
|
792
|
+
__param(2, (0, common_1.Body)()),
|
|
793
|
+
__param(3, (0, common_1.Res)()),
|
|
794
|
+
__metadata("design:type", Function),
|
|
795
|
+
__metadata("design:paramtypes", [Object, String, ScopeDtos_1.UpdateScopeRequest, Object]),
|
|
796
|
+
__metadata("design:returntype", Promise)
|
|
797
|
+
], PermissionController.prototype, "updateScope", null);
|
|
798
|
+
__decorate([
|
|
799
|
+
(0, swagger_1.ApiOperation)({ summary: 'Elimina uno scope applicativo', operationId: 'deleteScope' }),
|
|
800
|
+
(0, swagger_1.ApiParam)({ name: 'codiceScope', description: 'Codice dello scope', required: true }),
|
|
801
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Scope eliminato', type: BaseResponse_1.ActionResponse }),
|
|
802
|
+
(0, common_1.Delete)('scopes/:codiceScope'),
|
|
803
|
+
__param(0, (0, common_1.Req)()),
|
|
804
|
+
__param(1, (0, common_1.Param)('codiceScope')),
|
|
805
|
+
__param(2, (0, common_1.Res)()),
|
|
806
|
+
__metadata("design:type", Function),
|
|
807
|
+
__metadata("design:paramtypes", [Object, String, Object]),
|
|
808
|
+
__metadata("design:returntype", Promise)
|
|
809
|
+
], PermissionController.prototype, "deleteScope", null);
|
|
810
|
+
__decorate([
|
|
811
|
+
(0, swagger_1.ApiOperation)({ summary: 'Scope associati a un menu', operationId: 'getMenuScopes' }),
|
|
812
|
+
(0, swagger_1.ApiParam)({ name: 'codiceMenu', description: 'Codice del menu', required: true }),
|
|
813
|
+
(0, swagger_1.ApiOkResponse)({ description: 'Scope del menu', type: ScopeDtos_1.GetMenuScopesResponse }),
|
|
814
|
+
(0, common_1.Get)('menus/:codiceMenu/scopes'),
|
|
815
|
+
__param(0, (0, common_1.Param)('codiceMenu')),
|
|
816
|
+
__param(1, (0, common_1.Res)()),
|
|
817
|
+
__metadata("design:type", Function),
|
|
818
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
819
|
+
__metadata("design:returntype", Promise)
|
|
820
|
+
], PermissionController.prototype, "getMenuScopes", null);
|
|
821
|
+
__decorate([
|
|
822
|
+
(0, swagger_1.ApiOperation)({ summary: 'Sostituisce gli scope di un menu', operationId: 'setMenuScopes' }),
|
|
823
|
+
(0, swagger_1.ApiParam)({ name: 'codiceMenu', description: 'Codice del menu', required: true }),
|
|
824
|
+
(0, swagger_1.ApiBody)({ type: ScopeDtos_1.SetMenuScopesRequest }),
|
|
825
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Scope del menu aggiornati', type: BaseResponse_1.ActionResponse }),
|
|
826
|
+
(0, common_1.Put)('menus/:codiceMenu/scopes'),
|
|
827
|
+
__param(0, (0, common_1.Req)()),
|
|
828
|
+
__param(1, (0, common_1.Param)('codiceMenu')),
|
|
829
|
+
__param(2, (0, common_1.Body)()),
|
|
830
|
+
__param(3, (0, common_1.Res)()),
|
|
831
|
+
__metadata("design:type", Function),
|
|
832
|
+
__metadata("design:paramtypes", [Object, String, ScopeDtos_1.SetMenuScopesRequest, Object]),
|
|
833
|
+
__metadata("design:returntype", Promise)
|
|
834
|
+
], PermissionController.prototype, "setMenuScopes", null);
|
|
835
|
+
__decorate([
|
|
836
|
+
(0, swagger_1.ApiOperation)({ summary: 'Sostituisce i menu di uno scope', operationId: 'setScopeMenus' }),
|
|
837
|
+
(0, swagger_1.ApiParam)({ name: 'codiceScope', description: 'Codice dello scope', required: true }),
|
|
838
|
+
(0, swagger_1.ApiBody)({ type: ScopeDtos_1.SetScopeMenusRequest }),
|
|
839
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Menu dello scope aggiornati', type: BaseResponse_1.ActionResponse }),
|
|
840
|
+
(0, common_1.Put)('scopes/:codiceScope/menus'),
|
|
841
|
+
__param(0, (0, common_1.Req)()),
|
|
842
|
+
__param(1, (0, common_1.Param)('codiceScope')),
|
|
843
|
+
__param(2, (0, common_1.Body)()),
|
|
844
|
+
__param(3, (0, common_1.Res)()),
|
|
845
|
+
__metadata("design:type", Function),
|
|
846
|
+
__metadata("design:paramtypes", [Object, String, ScopeDtos_1.SetScopeMenusRequest, Object]),
|
|
847
|
+
__metadata("design:returntype", Promise)
|
|
848
|
+
], PermissionController.prototype, "setScopeMenus", null);
|
|
653
849
|
exports.PermissionController = PermissionController = PermissionController_1 = __decorate([
|
|
654
850
|
(0, swagger_1.ApiTags)('Permission'),
|
|
655
851
|
(0, swagger_1.ApiBearerAuth)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionController.js","sourceRoot":"","sources":["../../../src/accessi-module/Controllers/PermissionController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAewB;AACxB,6CAUyB;AAEzB,+CAAgD;AAChD,uDAAqE;AACrE,2FAAwF;AACxF,+EAA4E;AAC5E,qDAQ6B;AAC7B,mFAAgF;AAChF,+DAA4D;AAC5D,+DAA4D;AAC5D,uCAAoC;AACpC,mEAAgE;AAChE,uFAAoF;AACpF,qEAAkE;AAClE,sDAAqD;AACrD,6DAKmC;AAW5B,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAC/B,YACmB,iBAAoC,EACpC,WAAwB;QADxB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAEI,mBAAmB,CAAC,GAAa,EAAE,KAAc;QACvD,gFAAgF;QAChF,OAAO,yBAAa,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACW,sBAAsB,CAClC,KAA+B,EAC/B,YAAoB;;YAEpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;YACjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,4BAAmB,CAAC,4BAA4B,YAAY,GAAG,CAAC,CAAC;YAC7E,CAAC;YACD,IAAA,yCAAyB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;KAAA;IAgBK,QAAQ,CAAQ,GAAa;;YACjC,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,CAAC;gBAC/D,OAAO,yBAAa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B,WAAA,IAAA,YAAG,GAAE,CAAA;;;;0DAQ5F;AAUK;IARL,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,wCAAwC;QACjD,WAAW,EAAE,uBAAuB;KACrC,CAAC;IACD,IAAA,uBAAa,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,IAAI,EAAE,uCAAkB,EAAE,CAAC;IAC/E,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,sCAAsC,EAAE,IAAI,EAAE,uCAAkB,EAAE,CAAC;IAC3G,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,2BAA2B,EAAE,IAAI,EAAE,4BAAa,EAAE,CAAC;IAC3F,IAAA,YAAG,EAAC,sBAAsB,CAAC;IAEzB,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAK,EAAC,cAAc,EAAE,qBAAY,CAAC,CAAA;IACnC,WAAA,IAAA,YAAG,GAAE,CAAA;;;;iEAmBP;+BAlgBU,oBAAoB;IARhC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,oBAAoB,CAAC;IAChC,IAAA,kBAAS,EAAC,6BAAc,CAAC;IAC1B;;;OAGG;;qCAGqC,qCAAiB;QACvB,yBAAW;GAHhC,oBAAoB,CAmgBhC","sourcesContent":["import {\n BadRequestException,\n Body,\n Controller,\n Delete,\n Get,\n HttpStatus,\n Param,\n ParseIntPipe,\n Post,\n Put,\n Query,\n Req,\n Res,\n UseGuards,\n} from '@nestjs/common';\nimport {\n ApiBearerAuth,\n ApiBody,\n ApiInternalServerErrorResponse,\n ApiOkResponse,\n ApiOperation,\n ApiParam,\n ApiQuery,\n ApiResponse,\n ApiTags,\n} from '@nestjs/swagger';\nimport { Request, Response } from 'express';\nimport { RestUtilities } from '../../Utilities';\nimport { ActionResponse, ErrorResponse } from '../Dtos/BaseResponse';\nimport { AssignPermissionsToUserRequest } from '../Dtos/AssignPermissionsToUserRequest';\nimport { AssignRolesToUserRequest } from '../Dtos/AssignRolesToUserRequest';\nimport {\n CreateMenuGroupRequest,\n CreateMenuRequest,\n CreateMenuTypeRequest,\n GetMenuTypesResponse,\n UpdateMenuGroupRequest,\n UpdateMenuRequest,\n UpdateMenuTypeRequest,\n} from '../Dtos/CatalogDtos';\nimport { GetGroupsWithMenusResponse } from '../Dtos/GetGroupsWithMenusResponse';\nimport { GetMenusResponse } from '../Dtos/GetMenusResponse';\nimport { GetRolesResponse } from '../Dtos/GetRolesResponse';\nimport { Role } from '../Dtos/Role';\nimport { UserGrantsResponse } from '../Dtos/UserGrantsResponse';\nimport { PermissionService } from '../Services/PermissionService/PermissionService';\nimport { UserService } from '../Services/UserService/UserService';\nimport { JwtSimpleGuard } from '../jwt/jwt.strategy';\nimport {\n ensureAdmin,\n ensureCanManageTargetUser,\n ensureUserManagement,\n getAuthenticatedAccessiUser,\n} from '../security/accessControl';\nimport type { AuthenticatedAccessiUser } from '../security/accessControl';\n\n@ApiTags('Permission')\n@ApiBearerAuth()\n@Controller('accessi/permission')\n@UseGuards(JwtSimpleGuard)\n/**\n * API amministrative per ruoli, grant e catalogo menu. Le assegnazioni sono sostitutive, non incrementali:\n * il client deve inviare l'intera lista desiderata per non rimuovere voci involontariamente.\n */\nexport class PermissionController {\n constructor(\n private readonly permissionService: PermissionService,\n private readonly userService: UserService,\n ) {}\n\n private sendControllerError(res: Response, error: unknown) {\n // Lo status viene derivato centralmente da RestUtilities (HttpException o 500).\n return RestUtilities.sendErrorMessage(res, error, PermissionController.name);\n }\n\n /**\n * Verifica che l'attore possa gestire il target (ADMIN > SUPER > utente):\n * un superutente non puo' assegnare ruoli o permessi a un admin.\n */\n private async ensureManageableTarget(\n actor: AuthenticatedAccessiUser,\n codiceUtente: number,\n ): Promise<void> {\n const target = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!target) {\n throw new BadRequestException(`Nessun utente con codice ${codiceUtente}.`);\n }\n ensureCanManageTargetUser(actor, target);\n }\n\n @ApiOperation({\n summary: 'Ritorna i ruoli disponibili con i relativi menu',\n operationId: 'getRoles',\n description: 'Recupera tutti i ruoli presenti nel sistema con le relative voci di menu.',\n })\n @ApiOkResponse({ description: 'Elenco dei ruoli con i rispettivi menu', type: GetRolesResponse })\n @ApiInternalServerErrorResponse({ description: 'Errore interno del server', type: ErrorResponse })\n @ApiResponse({ status: HttpStatus.OK, description: 'Lista dei ruoli restituita con successo.', type: GetRolesResponse })\n @ApiResponse({\n status: HttpStatus.INTERNAL_SERVER_ERROR,\n description: 'Errore interno del server durante il recupero dei ruoli.',\n type: ErrorResponse,\n })\n @Get('roles')\n async getRoles(@Res() res: Response): Promise<Response> {\n try {\n const roles = await this.permissionService.getRolesWithMenus();\n return RestUtilities.sendBaseResponse(res, roles);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un ruolo esistente', operationId: 'updateRole' })\n @ApiParam({\n name: 'codiceRuolo',\n description: 'Codice identificativo del ruolo da aggiornare',\n required: true,\n example: 101,\n type: Number,\n })\n @ApiBody({\n description: 'Dati aggiornati del ruolo',\n type: Role,\n })\n @ApiResponse({ status: 200, description: 'Il ruolo e stato aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('update-role/:codiceRuolo')\n async updateRole(\n @Req() request: Request,\n @Param('codiceRuolo', ParseIntPipe) codiceRuolo: number,\n @Body() role: Role,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(\n getAuthenticatedAccessiUser(request),\n 'Solo gli amministratori possono modificare i ruoli.',\n );\n\n if (Number.isNaN(codiceRuolo)) throw new BadRequestException('Il codice del ruolo e obbligatorio.');\n if (!role.descrizioneRuolo) throw new BadRequestException('La descrizione del ruolo non puo essere vuota.');\n if (!role.menu || role.menu.length === 0) {\n throw new BadRequestException('Il ruolo deve avere almeno un menu.');\n }\n\n await this.permissionService.updateOrInsertRole(role, codiceRuolo);\n return RestUtilities.sendOKMessage(\n res,\n `Il ruolo ${codiceRuolo} e' stato aggiornato con successo.`,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo ruolo', operationId: 'createRole' })\n @ApiResponse({ status: 201, description: 'Il ruolo e stato creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @ApiBody({\n description: 'Dati del nuovo ruolo',\n required: true,\n type: Role,\n })\n @Post('create-role')\n async createRole(@Req() request: Request, @Res() res: Response, @Body() role: Role) {\n try {\n ensureAdmin(\n getAuthenticatedAccessiUser(request),\n 'Solo gli amministratori possono creare ruoli.',\n );\n\n if (!role) throw new BadRequestException('Il ruolo non puo essere vuoto.');\n if (!role.descrizioneRuolo) throw new BadRequestException('La descrizione del ruolo non puo essere vuota.');\n if (!role.menu || role.menu.length === 0) {\n throw new BadRequestException('Il ruolo deve avere almeno un menu.');\n }\n\n await this.permissionService.updateOrInsertRole(role);\n return RestUtilities.sendOKMessage(res, 'Il ruolo e stato creato con successo.', HttpStatus.CREATED);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Assegna piu ruoli a un utente', operationId: 'assignRolesToUser' })\n @ApiParam({\n name: 'codiceUtente',\n description: \"Codice identificativo dell'utente a cui assegnare i ruoli\",\n required: true,\n example: 22,\n })\n @ApiBody({\n type: AssignRolesToUserRequest,\n description: \"Lista dei ruoli da assegnare all'utente\",\n })\n @ApiResponse({ status: 200, description: \"Ruoli assegnati con successo all'utente\", type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('assign-roles/:codiceUtente')\n async assignRolesToUser(\n @Req() request: Request,\n @Res() res: Response,\n @Param('codiceUtente', ParseIntPipe) codiceUtente: number,\n @Body() assignRolesRequest: AssignRolesToUserRequest,\n ) {\n try {\n const authenticatedUser = getAuthenticatedAccessiUser(request);\n ensureUserManagement(\n authenticatedUser,\n 'Solo gli amministratori possono assegnare ruoli agli utenti.',\n );\n await this.ensureManageableTarget(authenticatedUser, codiceUtente);\n\n await this.permissionService.assignRolesToUser(codiceUtente, assignRolesRequest.roles);\n const responseMessage =\n assignRolesRequest.roles.length === 0\n ? `Tutti i ruoli sono stati rimossi dall'utente ${codiceUtente}.`\n : `I ruoli ${assignRolesRequest.roles.join(', ')} sono stati assegnati all'utente ${codiceUtente}.`;\n return RestUtilities.sendOKMessage(\n res,\n responseMessage,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({\n summary: 'Assegna abilitazioni dirette a un utente',\n operationId: 'assignPermissionsToUser',\n })\n @ApiParam({\n name: 'codiceUtente',\n description: \"Codice identificativo dell'utente a cui assegnare le abilitazioni\",\n required: true,\n example: 22,\n })\n @ApiBody({\n type: AssignPermissionsToUserRequest,\n description: \"Lista delle abilitazioni da assegnare all'utente\",\n })\n @ApiResponse({ status: 200, description: \"Abilitazioni assegnate con successo all'utente\", type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('assign-permissions/:codiceUtente')\n async assignPermissionsToUser(\n @Req() request: Request,\n @Res() res: Response,\n @Param('codiceUtente', ParseIntPipe) codiceUtente: number,\n @Body() assignPermissionsRequest: AssignPermissionsToUserRequest,\n ) {\n try {\n const authenticatedUser = getAuthenticatedAccessiUser(request);\n ensureUserManagement(\n authenticatedUser,\n 'Solo gli amministratori possono assegnare permessi agli utenti.',\n );\n await this.ensureManageableTarget(authenticatedUser, codiceUtente);\n\n await this.permissionService.assignPermissionsToUser(\n codiceUtente,\n assignPermissionsRequest.permissions,\n );\n const responseMessage =\n assignPermissionsRequest.permissions.length === 0\n ? `Tutte le abilitazioni sono state rimosse dall'utente ${codiceUtente}.`\n : `Le abilitazioni sono state assegnate all'utente ${codiceUtente}.`;\n return RestUtilities.sendOKMessage(\n res,\n responseMessage,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un ruolo esistente', operationId: 'deleteRole' })\n @ApiParam({\n name: 'codiceRuolo',\n description: 'Codice identificativo del ruolo da eliminare',\n required: true,\n example: 382,\n type: Number,\n })\n @ApiResponse({ status: 200, description: 'Ruolo eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore nei parametri della richiesta', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('delete-role/:codiceRuolo')\n async deleteRole(\n @Req() request: Request,\n @Param('codiceRuolo', ParseIntPipe) codiceRuolo: number,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(\n getAuthenticatedAccessiUser(request),\n 'Solo gli amministratori possono eliminare ruoli.',\n );\n\n await this.permissionService.deleteRole(codiceRuolo);\n return RestUtilities.sendOKMessage(\n res,\n `Il ruolo ${codiceRuolo} e' stato eliminato con successo.`,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Recupera tutti i menu disponibili', operationId: 'getMenus' })\n @ApiOkResponse({ description: 'Elenco menu', type: GetMenusResponse })\n @ApiResponse({ status: 200, description: 'Lista dei menu recuperata con successo', type: GetMenusResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Get('menus')\n async getMenus(@Res() res: Response) {\n try {\n const menus = await this.permissionService.getMenus();\n return RestUtilities.sendBaseResponse(res, menus);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({\n summary: 'Recupera tutti i gruppi disponibili con i relativi menu',\n operationId: 'getGroupsWithMenus',\n })\n @ApiOkResponse({\n description: 'Elenco gruppi con relativi menu',\n type: GetGroupsWithMenusResponse,\n })\n @ApiResponse({ status: 200, description: 'Lista dei menu recuperata con successo', type: GetGroupsWithMenusResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @ApiQuery({\n name: 'includeDisabled',\n required: false,\n type: Boolean,\n description: 'Quando true ritorna anche i menu e gruppi disabilitati.',\n })\n @Get('groups-with-menus')\n async getGroupsWithMenus(@Query('includeDisabled') includeDisabled: string, @Res() res: Response) {\n try {\n const includeDisabledFlag =\n typeof includeDisabled === 'string'\n ? ['true', '1', 'yes'].includes(includeDisabled.toLowerCase())\n : false;\n\n const menus = await this.permissionService.getGroupsWithMenus(includeDisabledFlag);\n return RestUtilities.sendBaseResponse(res, menus);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n // -------------------------------------------------------------------------\n // Gestione catalogo: tipi menu, gruppi, menu. Operazioni riservate al superutente.\n // -------------------------------------------------------------------------\n\n @ApiOperation({ summary: 'Recupera il catalogo dei tipi menu', operationId: 'getMenuTypes' })\n @ApiOkResponse({ description: 'Elenco dei tipi menu', type: GetMenuTypesResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Get('menu-types')\n async getMenuTypes(@Res() res: Response) {\n try {\n const types = await this.permissionService.getMenuTypes();\n return RestUtilities.sendBaseResponse(res, types);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo menu', operationId: 'createMenu' })\n @ApiBody({ type: CreateMenuRequest, description: 'Dati del nuovo menu' })\n @ApiResponse({ status: 201, description: 'Menu creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('menus')\n async createMenu(@Req() request: Request, @Body() body: CreateMenuRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare menu.');\n await this.permissionService.createMenu(body);\n return RestUtilities.sendOKMessage(\n res,\n `Il menu ${body.codiceMenu} e' stato creato con successo.`,\n HttpStatus.CREATED,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un menu esistente', operationId: 'updateMenu' })\n @ApiParam({ name: 'codiceMenu', description: 'Codice del menu da aggiornare', required: true, example: 'MNU001' })\n @ApiBody({ type: UpdateMenuRequest, description: 'Campi del menu da aggiornare' })\n @ApiResponse({ status: 200, description: 'Menu aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('menus/:codiceMenu')\n async updateMenu(\n @Req() request: Request,\n @Param('codiceMenu') codiceMenu: string,\n @Body() body: UpdateMenuRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare menu.');\n await this.permissionService.updateMenu(codiceMenu, body);\n return RestUtilities.sendOKMessage(res, `Il menu ${codiceMenu} e' stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un menu', operationId: 'deleteMenu' })\n @ApiParam({ name: 'codiceMenu', description: 'Codice del menu da eliminare', required: true, example: 'MNU001' })\n @ApiResponse({ status: 200, description: 'Menu eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('menus/:codiceMenu')\n async deleteMenu(@Req() request: Request, @Param('codiceMenu') codiceMenu: string, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare menu.');\n await this.permissionService.deleteMenu(codiceMenu);\n return RestUtilities.sendOKMessage(res, `Il menu ${codiceMenu} e' stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo gruppo menu', operationId: 'createMenuGroup' })\n @ApiBody({ type: CreateMenuGroupRequest, description: 'Dati del nuovo gruppo' })\n @ApiResponse({ status: 201, description: 'Gruppo creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('menu-groups')\n async createMenuGroup(@Req() request: Request, @Body() body: CreateMenuGroupRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare gruppi.');\n await this.permissionService.createMenuGroup(body);\n return RestUtilities.sendOKMessage(\n res,\n `Il gruppo ${body.codiceGruppo} e' stato creato con successo.`,\n HttpStatus.CREATED,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un gruppo menu', operationId: 'updateMenuGroup' })\n @ApiParam({ name: 'codiceGruppo', description: 'Codice del gruppo da aggiornare', required: true, example: 'A' })\n @ApiBody({ type: UpdateMenuGroupRequest, description: 'Campi del gruppo da aggiornare' })\n @ApiResponse({ status: 200, description: 'Gruppo aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('menu-groups/:codiceGruppo')\n async updateMenuGroup(\n @Req() request: Request,\n @Param('codiceGruppo') codiceGruppo: string,\n @Body() body: UpdateMenuGroupRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare gruppi.');\n await this.permissionService.updateMenuGroup(codiceGruppo, body);\n return RestUtilities.sendOKMessage(res, `Il gruppo ${codiceGruppo} e' stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un gruppo menu', operationId: 'deleteMenuGroup' })\n @ApiParam({ name: 'codiceGruppo', description: 'Codice del gruppo da eliminare', required: true, example: 'A' })\n @ApiResponse({ status: 200, description: 'Gruppo eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('menu-groups/:codiceGruppo')\n async deleteMenuGroup(@Req() request: Request, @Param('codiceGruppo') codiceGruppo: string, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare gruppi.');\n await this.permissionService.deleteMenuGroup(codiceGruppo);\n return RestUtilities.sendOKMessage(res, `Il gruppo ${codiceGruppo} e' stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo tipo menu', operationId: 'createMenuType' })\n @ApiBody({ type: CreateMenuTypeRequest, description: 'Dati del nuovo tipo menu' })\n @ApiResponse({ status: 201, description: 'Tipo menu creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('menu-types')\n async createMenuType(@Req() request: Request, @Body() body: CreateMenuTypeRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare tipi menu.');\n await this.permissionService.createMenuType(body);\n return RestUtilities.sendOKMessage(\n res,\n `Il tipo menu ${body.codiceTipo} e' stato creato con successo.`,\n HttpStatus.CREATED,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un tipo menu', operationId: 'updateMenuType' })\n @ApiParam({ name: 'codiceTipo', description: 'Codice del tipo menu da aggiornare', required: true, example: 'A' })\n @ApiBody({ type: UpdateMenuTypeRequest, description: 'Campi del tipo menu da aggiornare' })\n @ApiResponse({ status: 200, description: 'Tipo menu aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('menu-types/:codiceTipo')\n async updateMenuType(\n @Req() request: Request,\n @Param('codiceTipo') codiceTipo: string,\n @Body() body: UpdateMenuTypeRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare tipi menu.');\n await this.permissionService.updateMenuType(codiceTipo, body);\n return RestUtilities.sendOKMessage(res, `Il tipo menu ${codiceTipo} e' stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un tipo menu', operationId: 'deleteMenuType' })\n @ApiParam({ name: 'codiceTipo', description: 'Codice del tipo menu da eliminare', required: true, example: 'A' })\n @ApiResponse({ status: 200, description: 'Tipo menu eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('menu-types/:codiceTipo')\n async deleteMenuType(@Req() request: Request, @Param('codiceTipo') codiceTipo: string, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare tipi menu.');\n await this.permissionService.deleteMenuType(codiceTipo);\n return RestUtilities.sendOKMessage(res, `Il tipo menu ${codiceTipo} e' stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({\n summary: 'Recupera i ruoli e i menu di un utente',\n operationId: 'getUserRolesAndGrants',\n })\n @ApiOkResponse({ description: 'Elenco grant utente', type: UserGrantsResponse })\n @ApiResponse({ status: 200, description: 'Grant utente recuperati con successo', type: UserGrantsResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Get('grants/:codiceUtente')\n async getUserRolesAndGrants(\n @Req() request: Request,\n @Param('codiceUtente', ParseIntPipe) codiceUtente: number,\n @Res() res: Response,\n ) {\n try {\n const authenticatedUser = getAuthenticatedAccessiUser(request);\n if (authenticatedUser.codiceUtente !== codiceUtente) {\n ensureUserManagement(\n authenticatedUser,\n 'Puoi consultare solo i tuoi grant, salvo privilegi amministrativi.',\n );\n // Anche un superutente non puo' leggere i grant di un admin: stessa\n // gerarchia ADMIN > SUPER applicata alle operazioni di scrittura.\n await this.ensureManageableTarget(authenticatedUser, codiceUtente);\n }\n\n const menus = await this.permissionService.getUserRolesAndGrants(codiceUtente);\n return RestUtilities.sendBaseResponse(res, menus);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PermissionController.js","sourceRoot":"","sources":["../../../src/accessi-module/Controllers/PermissionController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAewB;AACxB,6CAUyB;AAEzB,+CAAgD;AAChD,uDAAqE;AACrE,2FAAwF;AACxF,+EAA4E;AAC5E,iDAO2B;AAC3B,qDAQ6B;AAC7B,mFAAgF;AAChF,+DAA4D;AAC5D,+DAA4D;AAC5D,uCAAoC;AACpC,mEAAgE;AAChE,uFAAoF;AACpF,qEAAkE;AAClE,sDAAqD;AACrD,6DAKmC;AAW5B,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAC/B,YACmB,iBAAoC,EACpC,WAAwB;QADxB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAEI,mBAAmB,CAAC,GAAa,EAAE,KAAc;QACvD,gFAAgF;QAChF,OAAO,yBAAa,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAC/E,CAAC;IAED;;;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qDADQ,gCAAoB;;yDAUnC;+BAppBU,oBAAoB;IARhC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,oBAAoB,CAAC;IAChC,IAAA,kBAAS,EAAC,6BAAc,CAAC;IAC1B;;;OAGG;;qCAGqC,qCAAiB;QACvB,yBAAW;GAHhC,oBAAoB,CAspBhC","sourcesContent":["import {\n BadRequestException,\n Body,\n Controller,\n Delete,\n Get,\n HttpStatus,\n Param,\n ParseIntPipe,\n Post,\n Put,\n Query,\n Req,\n Res,\n UseGuards,\n} from '@nestjs/common';\nimport {\n ApiBearerAuth,\n ApiBody,\n ApiInternalServerErrorResponse,\n ApiOkResponse,\n ApiOperation,\n ApiParam,\n ApiQuery,\n ApiResponse,\n ApiTags,\n} from '@nestjs/swagger';\nimport { Request, Response } from 'express';\nimport { RestUtilities } from '../../Utilities';\nimport { ActionResponse, ErrorResponse } from '../Dtos/BaseResponse';\nimport { AssignPermissionsToUserRequest } from '../Dtos/AssignPermissionsToUserRequest';\nimport { AssignRolesToUserRequest } from '../Dtos/AssignRolesToUserRequest';\nimport {\n CreateScopeRequest,\n GetMenuScopesResponse,\n GetScopesResponse,\n SetMenuScopesRequest,\n SetScopeMenusRequest,\n UpdateScopeRequest,\n} from '../Dtos/ScopeDtos';\nimport {\n CreateMenuGroupRequest,\n CreateMenuRequest,\n CreateMenuTypeRequest,\n GetMenuTypesResponse,\n UpdateMenuGroupRequest,\n UpdateMenuRequest,\n UpdateMenuTypeRequest,\n} from '../Dtos/CatalogDtos';\nimport { GetGroupsWithMenusResponse } from '../Dtos/GetGroupsWithMenusResponse';\nimport { GetMenusResponse } from '../Dtos/GetMenusResponse';\nimport { GetRolesResponse } from '../Dtos/GetRolesResponse';\nimport { Role } from '../Dtos/Role';\nimport { UserGrantsResponse } from '../Dtos/UserGrantsResponse';\nimport { PermissionService } from '../Services/PermissionService/PermissionService';\nimport { UserService } from '../Services/UserService/UserService';\nimport { JwtSimpleGuard } from '../jwt/jwt.strategy';\nimport {\n ensureAdmin,\n ensureCanManageTargetUser,\n ensureUserManagement,\n getAuthenticatedAccessiUser,\n} from '../security/accessControl';\nimport type { AuthenticatedAccessiUser } from '../security/accessControl';\n\n@ApiTags('Permission')\n@ApiBearerAuth()\n@Controller('accessi/permission')\n@UseGuards(JwtSimpleGuard)\n/**\n * API amministrative per ruoli, grant e catalogo menu. Le assegnazioni sono sostitutive, non incrementali:\n * il client deve inviare l'intera lista desiderata per non rimuovere voci involontariamente.\n */\nexport class PermissionController {\n constructor(\n private readonly permissionService: PermissionService,\n private readonly userService: UserService,\n ) {}\n\n private sendControllerError(res: Response, error: unknown) {\n // Lo status viene derivato centralmente da RestUtilities (HttpException o 500).\n return RestUtilities.sendErrorMessage(res, error, PermissionController.name);\n }\n\n /**\n * Verifica che l'attore possa gestire il target (ADMIN > SUPER > utente):\n * un superutente non puo' assegnare ruoli o permessi a un admin.\n */\n private async ensureManageableTarget(\n actor: AuthenticatedAccessiUser,\n codiceUtente: number,\n ): Promise<void> {\n const target = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!target) {\n throw new BadRequestException(`Nessun utente con codice ${codiceUtente}.`);\n }\n ensureCanManageTargetUser(actor, target);\n }\n\n @ApiOperation({\n summary: 'Ritorna i ruoli disponibili con i relativi menu',\n operationId: 'getRoles',\n description: 'Recupera tutti i ruoli presenti nel sistema con le relative voci di menu.',\n })\n @ApiOkResponse({ description: 'Elenco dei ruoli con i rispettivi menu', type: GetRolesResponse })\n @ApiInternalServerErrorResponse({ description: 'Errore interno del server', type: ErrorResponse })\n @ApiResponse({ status: HttpStatus.OK, description: 'Lista dei ruoli restituita con successo.', type: GetRolesResponse })\n @ApiResponse({\n status: HttpStatus.INTERNAL_SERVER_ERROR,\n description: 'Errore interno del server durante il recupero dei ruoli.',\n type: ErrorResponse,\n })\n @Get('roles')\n async getRoles(@Res() res: Response): Promise<Response> {\n try {\n const roles = await this.permissionService.getRolesWithMenus();\n return RestUtilities.sendBaseResponse(res, roles);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un ruolo esistente', operationId: 'updateRole' })\n @ApiParam({\n name: 'codiceRuolo',\n description: 'Codice identificativo del ruolo da aggiornare',\n required: true,\n example: 101,\n type: Number,\n })\n @ApiBody({\n description: 'Dati aggiornati del ruolo',\n type: Role,\n })\n @ApiResponse({ status: 200, description: 'Il ruolo e stato aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('update-role/:codiceRuolo')\n async updateRole(\n @Req() request: Request,\n @Param('codiceRuolo', ParseIntPipe) codiceRuolo: number,\n @Body() role: Role,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(\n getAuthenticatedAccessiUser(request),\n 'Solo gli amministratori possono modificare i ruoli.',\n );\n\n if (Number.isNaN(codiceRuolo)) throw new BadRequestException('Il codice del ruolo e obbligatorio.');\n if (!role.descrizioneRuolo) throw new BadRequestException('La descrizione del ruolo non puo essere vuota.');\n if (!role.menu || role.menu.length === 0) {\n throw new BadRequestException('Il ruolo deve avere almeno un menu.');\n }\n\n await this.permissionService.updateOrInsertRole(role, codiceRuolo);\n return RestUtilities.sendOKMessage(\n res,\n `Il ruolo ${codiceRuolo} e' stato aggiornato con successo.`,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo ruolo', operationId: 'createRole' })\n @ApiResponse({ status: 201, description: 'Il ruolo e stato creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @ApiBody({\n description: 'Dati del nuovo ruolo',\n required: true,\n type: Role,\n })\n @Post('create-role')\n async createRole(@Req() request: Request, @Res() res: Response, @Body() role: Role) {\n try {\n ensureAdmin(\n getAuthenticatedAccessiUser(request),\n 'Solo gli amministratori possono creare ruoli.',\n );\n\n if (!role) throw new BadRequestException('Il ruolo non puo essere vuoto.');\n if (!role.descrizioneRuolo) throw new BadRequestException('La descrizione del ruolo non puo essere vuota.');\n if (!role.menu || role.menu.length === 0) {\n throw new BadRequestException('Il ruolo deve avere almeno un menu.');\n }\n\n await this.permissionService.updateOrInsertRole(role);\n return RestUtilities.sendOKMessage(res, 'Il ruolo e stato creato con successo.', HttpStatus.CREATED);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Assegna piu ruoli a un utente', operationId: 'assignRolesToUser' })\n @ApiParam({\n name: 'codiceUtente',\n description: \"Codice identificativo dell'utente a cui assegnare i ruoli\",\n required: true,\n example: 22,\n })\n @ApiBody({\n type: AssignRolesToUserRequest,\n description: \"Lista dei ruoli da assegnare all'utente\",\n })\n @ApiResponse({ status: 200, description: \"Ruoli assegnati con successo all'utente\", type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('assign-roles/:codiceUtente')\n async assignRolesToUser(\n @Req() request: Request,\n @Res() res: Response,\n @Param('codiceUtente', ParseIntPipe) codiceUtente: number,\n @Body() assignRolesRequest: AssignRolesToUserRequest,\n ) {\n try {\n const authenticatedUser = getAuthenticatedAccessiUser(request);\n ensureUserManagement(\n authenticatedUser,\n 'Solo gli amministratori possono assegnare ruoli agli utenti.',\n );\n await this.ensureManageableTarget(authenticatedUser, codiceUtente);\n\n await this.permissionService.assignRolesToUser(codiceUtente, assignRolesRequest.roles);\n const responseMessage =\n assignRolesRequest.roles.length === 0\n ? `Tutti i ruoli sono stati rimossi dall'utente ${codiceUtente}.`\n : `I ruoli ${assignRolesRequest.roles.join(', ')} sono stati assegnati all'utente ${codiceUtente}.`;\n return RestUtilities.sendOKMessage(\n res,\n responseMessage,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({\n summary: 'Assegna abilitazioni dirette a un utente',\n operationId: 'assignPermissionsToUser',\n })\n @ApiParam({\n name: 'codiceUtente',\n description: \"Codice identificativo dell'utente a cui assegnare le abilitazioni\",\n required: true,\n example: 22,\n })\n @ApiBody({\n type: AssignPermissionsToUserRequest,\n description: \"Lista delle abilitazioni da assegnare all'utente\",\n })\n @ApiResponse({ status: 200, description: \"Abilitazioni assegnate con successo all'utente\", type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore di validazione nei dati inviati', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('assign-permissions/:codiceUtente')\n async assignPermissionsToUser(\n @Req() request: Request,\n @Res() res: Response,\n @Param('codiceUtente', ParseIntPipe) codiceUtente: number,\n @Body() assignPermissionsRequest: AssignPermissionsToUserRequest,\n ) {\n try {\n const authenticatedUser = getAuthenticatedAccessiUser(request);\n ensureUserManagement(\n authenticatedUser,\n 'Solo gli amministratori possono assegnare permessi agli utenti.',\n );\n await this.ensureManageableTarget(authenticatedUser, codiceUtente);\n\n await this.permissionService.assignPermissionsToUser(\n codiceUtente,\n assignPermissionsRequest.permissions,\n );\n const responseMessage =\n assignPermissionsRequest.permissions.length === 0\n ? `Tutte le abilitazioni sono state rimosse dall'utente ${codiceUtente}.`\n : `Le abilitazioni sono state assegnate all'utente ${codiceUtente}.`;\n return RestUtilities.sendOKMessage(\n res,\n responseMessage,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un ruolo esistente', operationId: 'deleteRole' })\n @ApiParam({\n name: 'codiceRuolo',\n description: 'Codice identificativo del ruolo da eliminare',\n required: true,\n example: 382,\n type: Number,\n })\n @ApiResponse({ status: 200, description: 'Ruolo eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Errore nei parametri della richiesta', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('delete-role/:codiceRuolo')\n async deleteRole(\n @Req() request: Request,\n @Param('codiceRuolo', ParseIntPipe) codiceRuolo: number,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(\n getAuthenticatedAccessiUser(request),\n 'Solo gli amministratori possono eliminare ruoli.',\n );\n\n await this.permissionService.deleteRole(codiceRuolo);\n return RestUtilities.sendOKMessage(\n res,\n `Il ruolo ${codiceRuolo} e' stato eliminato con successo.`,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Recupera tutti i menu disponibili', operationId: 'getMenus' })\n @ApiOkResponse({ description: 'Elenco menu', type: GetMenusResponse })\n @ApiResponse({ status: 200, description: 'Lista dei menu recuperata con successo', type: GetMenusResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @ApiQuery({\n name: 'scope',\n required: false,\n type: String,\n description: 'Filtra per scope applicativi (CSV, es. STEX,TINTEMIX). Assente = tutti.',\n })\n @Get('menus')\n async getMenus(@Query('scope') scope: string, @Res() res: Response) {\n try {\n const menus = await this.permissionService.getMenus(scope);\n return RestUtilities.sendBaseResponse(res, menus);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({\n summary: 'Recupera tutti i gruppi disponibili con i relativi menu',\n operationId: 'getGroupsWithMenus',\n })\n @ApiOkResponse({\n description: 'Elenco gruppi con relativi menu',\n type: GetGroupsWithMenusResponse,\n })\n @ApiResponse({ status: 200, description: 'Lista dei menu recuperata con successo', type: GetGroupsWithMenusResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @ApiQuery({\n name: 'includeDisabled',\n required: false,\n type: Boolean,\n description: 'Quando true ritorna anche i menu e gruppi disabilitati.',\n })\n @ApiQuery({\n name: 'scope',\n required: false,\n type: String,\n description: 'Filtra per scope applicativi (CSV, es. STEX,TINTEMIX). Assente = tutti.',\n })\n @Get('groups-with-menus')\n async getGroupsWithMenus(\n @Query('includeDisabled') includeDisabled: string,\n @Query('scope') scope: string,\n @Res() res: Response,\n ) {\n try {\n const includeDisabledFlag =\n typeof includeDisabled === 'string'\n ? ['true', '1', 'yes'].includes(includeDisabled.toLowerCase())\n : false;\n\n const menus = await this.permissionService.getGroupsWithMenus(includeDisabledFlag, scope);\n return RestUtilities.sendBaseResponse(res, menus);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n // -------------------------------------------------------------------------\n // Gestione catalogo: tipi menu, gruppi, menu. Operazioni riservate al superutente.\n // -------------------------------------------------------------------------\n\n @ApiOperation({ summary: 'Recupera il catalogo dei tipi menu', operationId: 'getMenuTypes' })\n @ApiOkResponse({ description: 'Elenco dei tipi menu', type: GetMenuTypesResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Get('menu-types')\n async getMenuTypes(@Res() res: Response) {\n try {\n const types = await this.permissionService.getMenuTypes();\n return RestUtilities.sendBaseResponse(res, types);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo menu', operationId: 'createMenu' })\n @ApiBody({ type: CreateMenuRequest, description: 'Dati del nuovo menu' })\n @ApiResponse({ status: 201, description: 'Menu creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('menus')\n async createMenu(@Req() request: Request, @Body() body: CreateMenuRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare menu.');\n await this.permissionService.createMenu(body);\n return RestUtilities.sendOKMessage(\n res,\n `Il menu ${body.codiceMenu} e' stato creato con successo.`,\n HttpStatus.CREATED,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un menu esistente', operationId: 'updateMenu' })\n @ApiParam({ name: 'codiceMenu', description: 'Codice del menu da aggiornare', required: true, example: 'MNU001' })\n @ApiBody({ type: UpdateMenuRequest, description: 'Campi del menu da aggiornare' })\n @ApiResponse({ status: 200, description: 'Menu aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('menus/:codiceMenu')\n async updateMenu(\n @Req() request: Request,\n @Param('codiceMenu') codiceMenu: string,\n @Body() body: UpdateMenuRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare menu.');\n await this.permissionService.updateMenu(codiceMenu, body);\n return RestUtilities.sendOKMessage(res, `Il menu ${codiceMenu} e' stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un menu', operationId: 'deleteMenu' })\n @ApiParam({ name: 'codiceMenu', description: 'Codice del menu da eliminare', required: true, example: 'MNU001' })\n @ApiResponse({ status: 200, description: 'Menu eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('menus/:codiceMenu')\n async deleteMenu(@Req() request: Request, @Param('codiceMenu') codiceMenu: string, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare menu.');\n await this.permissionService.deleteMenu(codiceMenu);\n return RestUtilities.sendOKMessage(res, `Il menu ${codiceMenu} e' stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo gruppo menu', operationId: 'createMenuGroup' })\n @ApiBody({ type: CreateMenuGroupRequest, description: 'Dati del nuovo gruppo' })\n @ApiResponse({ status: 201, description: 'Gruppo creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('menu-groups')\n async createMenuGroup(@Req() request: Request, @Body() body: CreateMenuGroupRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare gruppi.');\n await this.permissionService.createMenuGroup(body);\n return RestUtilities.sendOKMessage(\n res,\n `Il gruppo ${body.codiceGruppo} e' stato creato con successo.`,\n HttpStatus.CREATED,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un gruppo menu', operationId: 'updateMenuGroup' })\n @ApiParam({ name: 'codiceGruppo', description: 'Codice del gruppo da aggiornare', required: true, example: 'A' })\n @ApiBody({ type: UpdateMenuGroupRequest, description: 'Campi del gruppo da aggiornare' })\n @ApiResponse({ status: 200, description: 'Gruppo aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('menu-groups/:codiceGruppo')\n async updateMenuGroup(\n @Req() request: Request,\n @Param('codiceGruppo') codiceGruppo: string,\n @Body() body: UpdateMenuGroupRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare gruppi.');\n await this.permissionService.updateMenuGroup(codiceGruppo, body);\n return RestUtilities.sendOKMessage(res, `Il gruppo ${codiceGruppo} e' stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un gruppo menu', operationId: 'deleteMenuGroup' })\n @ApiParam({ name: 'codiceGruppo', description: 'Codice del gruppo da eliminare', required: true, example: 'A' })\n @ApiResponse({ status: 200, description: 'Gruppo eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('menu-groups/:codiceGruppo')\n async deleteMenuGroup(@Req() request: Request, @Param('codiceGruppo') codiceGruppo: string, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare gruppi.');\n await this.permissionService.deleteMenuGroup(codiceGruppo);\n return RestUtilities.sendOKMessage(res, `Il gruppo ${codiceGruppo} e' stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea un nuovo tipo menu', operationId: 'createMenuType' })\n @ApiBody({ type: CreateMenuTypeRequest, description: 'Dati del nuovo tipo menu' })\n @ApiResponse({ status: 201, description: 'Tipo menu creato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Post('menu-types')\n async createMenuType(@Req() request: Request, @Body() body: CreateMenuTypeRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare tipi menu.');\n await this.permissionService.createMenuType(body);\n return RestUtilities.sendOKMessage(\n res,\n `Il tipo menu ${body.codiceTipo} e' stato creato con successo.`,\n HttpStatus.CREATED,\n );\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna un tipo menu', operationId: 'updateMenuType' })\n @ApiParam({ name: 'codiceTipo', description: 'Codice del tipo menu da aggiornare', required: true, example: 'A' })\n @ApiBody({ type: UpdateMenuTypeRequest, description: 'Campi del tipo menu da aggiornare' })\n @ApiResponse({ status: 200, description: 'Tipo menu aggiornato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Put('menu-types/:codiceTipo')\n async updateMenuType(\n @Req() request: Request,\n @Param('codiceTipo') codiceTipo: string,\n @Body() body: UpdateMenuTypeRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare tipi menu.');\n await this.permissionService.updateMenuType(codiceTipo, body);\n return RestUtilities.sendOKMessage(res, `Il tipo menu ${codiceTipo} e' stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina un tipo menu', operationId: 'deleteMenuType' })\n @ApiParam({ name: 'codiceTipo', description: 'Codice del tipo menu da eliminare', required: true, example: 'A' })\n @ApiResponse({ status: 200, description: 'Tipo menu eliminato con successo', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Delete('menu-types/:codiceTipo')\n async deleteMenuType(@Req() request: Request, @Param('codiceTipo') codiceTipo: string, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare tipi menu.');\n await this.permissionService.deleteMenuType(codiceTipo);\n return RestUtilities.sendOKMessage(res, `Il tipo menu ${codiceTipo} e' stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({\n summary: 'Recupera i ruoli e i menu di un utente',\n operationId: 'getUserRolesAndGrants',\n })\n @ApiOkResponse({ description: 'Elenco grant utente', type: UserGrantsResponse })\n @ApiResponse({ status: 200, description: 'Grant utente recuperati con successo', type: UserGrantsResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @ApiQuery({\n name: 'scope',\n required: false,\n type: String,\n description: 'Filtra i grant per scope applicativi (CSV). Assente = tutti.',\n })\n @Get('grants/:codiceUtente')\n async getUserRolesAndGrants(\n @Req() request: Request,\n @Param('codiceUtente', ParseIntPipe) codiceUtente: number,\n @Query('scope') scope: string,\n @Res() res: Response,\n ) {\n try {\n const authenticatedUser = getAuthenticatedAccessiUser(request);\n if (authenticatedUser.codiceUtente !== codiceUtente) {\n ensureUserManagement(\n authenticatedUser,\n 'Puoi consultare solo i tuoi grant, salvo privilegi amministrativi.',\n );\n // Anche un superutente non puo' leggere i grant di un admin: stessa\n // gerarchia ADMIN > SUPER applicata alle operazioni di scrittura.\n await this.ensureManageableTarget(authenticatedUser, codiceUtente);\n }\n\n const menus = await this.permissionService.getUserRolesAndGrants(codiceUtente, scope);\n return RestUtilities.sendBaseResponse(res, menus);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n // -------------------------------------------------------------------------\n // Scope applicativi: catalogo e associazioni menu/scope.\n // -------------------------------------------------------------------------\n\n @ApiOperation({ summary: 'Recupera il catalogo degli scope applicativi', operationId: 'getScopes' })\n @ApiOkResponse({ description: 'Elenco degli scope', type: GetScopesResponse })\n @ApiResponse({ status: 500, description: 'Errore interno del server', type: ErrorResponse })\n @Get('scopes')\n async getScopes(@Res() res: Response) {\n try {\n const scopes = await this.permissionService.getScopes();\n return RestUtilities.sendBaseResponse(res, scopes);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Crea uno scope applicativo', operationId: 'createScope' })\n @ApiBody({ type: CreateScopeRequest })\n @ApiResponse({ status: 201, description: 'Scope creato', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @Post('scopes')\n async createScope(@Req() request: Request, @Body() body: CreateScopeRequest, @Res() res: Response) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono creare scope.');\n await this.permissionService.createScope(body);\n return RestUtilities.sendOKMessage(res, `Lo scope ${body.codice} e stato creato con successo.`, HttpStatus.CREATED);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Aggiorna uno scope applicativo', operationId: 'updateScope' })\n @ApiParam({ name: 'codiceScope', description: 'Codice dello scope', required: true })\n @ApiBody({ type: UpdateScopeRequest })\n @ApiResponse({ status: 200, description: 'Scope aggiornato', type: ActionResponse })\n @ApiResponse({ status: 400, description: 'Dati non validi', type: ErrorResponse })\n @Put('scopes/:codiceScope')\n async updateScope(\n @Req() request: Request,\n @Param('codiceScope') codiceScope: string,\n @Body() body: UpdateScopeRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare scope.');\n await this.permissionService.updateScope(codiceScope, body);\n return RestUtilities.sendOKMessage(res, `Lo scope ${codiceScope} e stato aggiornato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Elimina uno scope applicativo', operationId: 'deleteScope' })\n @ApiParam({ name: 'codiceScope', description: 'Codice dello scope', required: true })\n @ApiResponse({ status: 200, description: 'Scope eliminato', type: ActionResponse })\n @Delete('scopes/:codiceScope')\n async deleteScope(\n @Req() request: Request,\n @Param('codiceScope') codiceScope: string,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono eliminare scope.');\n await this.permissionService.deleteScope(codiceScope);\n return RestUtilities.sendOKMessage(res, `Lo scope ${codiceScope} e stato eliminato con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Scope associati a un menu', operationId: 'getMenuScopes' })\n @ApiParam({ name: 'codiceMenu', description: 'Codice del menu', required: true })\n @ApiOkResponse({ description: 'Scope del menu', type: GetMenuScopesResponse })\n @Get('menus/:codiceMenu/scopes')\n async getMenuScopes(@Param('codiceMenu') codiceMenu: string, @Res() res: Response) {\n try {\n const scopes = await this.permissionService.getMenuScopes(codiceMenu);\n return RestUtilities.sendBaseResponse(res, scopes);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Sostituisce gli scope di un menu', operationId: 'setMenuScopes' })\n @ApiParam({ name: 'codiceMenu', description: 'Codice del menu', required: true })\n @ApiBody({ type: SetMenuScopesRequest })\n @ApiResponse({ status: 200, description: 'Scope del menu aggiornati', type: ActionResponse })\n @Put('menus/:codiceMenu/scopes')\n async setMenuScopes(\n @Req() request: Request,\n @Param('codiceMenu') codiceMenu: string,\n @Body() body: SetMenuScopesRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare gli scope.');\n await this.permissionService.setMenuScopes(codiceMenu, body.scopes);\n return RestUtilities.sendOKMessage(res, `Scope del menu ${codiceMenu} aggiornati con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n @ApiOperation({ summary: 'Sostituisce i menu di uno scope', operationId: 'setScopeMenus' })\n @ApiParam({ name: 'codiceScope', description: 'Codice dello scope', required: true })\n @ApiBody({ type: SetScopeMenusRequest })\n @ApiResponse({ status: 200, description: 'Menu dello scope aggiornati', type: ActionResponse })\n @Put('scopes/:codiceScope/menus')\n async setScopeMenus(\n @Req() request: Request,\n @Param('codiceScope') codiceScope: string,\n @Body() body: SetScopeMenusRequest,\n @Res() res: Response,\n ) {\n try {\n ensureAdmin(getAuthenticatedAccessiUser(request), 'Solo gli amministratori possono modificare gli scope.');\n await this.permissionService.setScopeMenus(codiceScope, body.menu);\n return RestUtilities.sendOKMessage(res, `Menu dello scope ${codiceScope} aggiornati con successo.`);\n } catch (error) {\n return this.sendControllerError(res, error);\n }\n }\n\n}\n"]}
|
|
@@ -34,4 +34,14 @@ __decorate([
|
|
|
34
34
|
(0, class_validator_1.Length)(8, 100, { message: "La password deve essere tra 8 e 100 caratteri." }),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], LoginRequest.prototype, "password", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
39
|
+
description: 'Scope applicativi separati da virgola (es. STEX,TINTEMIX). Assente = nessun filtro.',
|
|
40
|
+
example: 'STEX'
|
|
41
|
+
}),
|
|
42
|
+
(0, class_validator_1.IsString)({ message: "Lo scope deve essere una stringa." }),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.MaxLength)(200, { message: "Lo scope non puo superare 200 caratteri." }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], LoginRequest.prototype, "scope", void 0);
|
|
37
47
|
//# sourceMappingURL=LoginRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginRequest.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/LoginRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"LoginRequest.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/LoginRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAA0E;AAE1E,MAAa,YAAY;CA4BxB;AA5BD,oCA4BC;AApBG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,aAAa;KACzB,CAAC;IACD,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;IACzD,IAAA,wBAAM,EAAC,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;;2CACzD;AASf;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,mFAAmF;QAChG,OAAO,EAAE,iBAAiB;KAC7B,CAAC;IACD,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IAC7D,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC;;8CAC5D;AAUlB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,qFAAqF;QAClG,OAAO,EAAE,MAAM;KAClB,CAAC;IACD,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IAC1D,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;;2CACzD","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\";\nimport { IsOptional, IsString, Length, MaxLength } from \"class-validator\";\n\nexport class LoginRequest {\n \n @ApiProperty({\n description: 'Email dell\\'utente',\n example: 'mario.rossi'\n })\n @IsString({ message: \"L'email deve essere una stringa.\" })\n @Length(3, 50, { message: \"L'email deve essere tra 3 e 50 caratteri.\" })\n email!: string;\n\n @ApiPropertyOptional({\n description: 'Password: omettere soltanto per utenti con accesso tramite solo codice abilitato.',\n example: 'Str0ngP@ssw0rd!'\n })\n @IsString({ message: \"La password deve essere una stringa.\" })\n @IsOptional()\n @Length(8, 100, { message: \"La password deve essere tra 8 e 100 caratteri.\" })\n password?: string;\n\n /** Filtro opzionale degli scope applicativi (CSV). Assente = tutti i menu. */\n @ApiPropertyOptional({\n description: 'Scope applicativi separati da virgola (es. STEX,TINTEMIX). Assente = nessun filtro.',\n example: 'STEX'\n })\n @IsString({ message: \"Lo scope deve essere una stringa.\" })\n @IsOptional()\n @MaxLength(200, { message: \"Lo scope non puo superare 200 caratteri.\" })\n scope?: string;\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseResponse } from './BaseResponse';
|
|
2
|
+
/**
|
|
3
|
+
* Scope applicativi: etichette che decidono in quali applicazioni un menu e
|
|
4
|
+
* visibile. Il codice e la chiave stabile usata dalle API (`?scope=STEX`).
|
|
5
|
+
*/
|
|
6
|
+
export declare class ScopeEntity {
|
|
7
|
+
codice: string;
|
|
8
|
+
nome: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class GetScopesResponse extends BaseResponse {
|
|
11
|
+
Result: ScopeEntity[];
|
|
12
|
+
}
|
|
13
|
+
export declare class CreateScopeRequest {
|
|
14
|
+
codice: string;
|
|
15
|
+
nome: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class UpdateScopeRequest {
|
|
18
|
+
nome?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class SetMenuScopesRequest {
|
|
21
|
+
scopes: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare class SetScopeMenusRequest {
|
|
24
|
+
menu: string[];
|
|
25
|
+
}
|
|
26
|
+
export declare class GetMenuScopesResponse extends BaseResponse {
|
|
27
|
+
Result: string[];
|
|
28
|
+
}
|