mapa-library-ui 0.43.8 → 0.43.9
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/esm2020/src/lib/core/guards/authorize-guard/authorize.mjs +5 -0
- package/esm2020/src/lib/core/guards/authorize-guard/lib/core/enums/permissions.enum.mjs +41 -0
- package/esm2020/src/lib/core/guards/authorize-guard/lib/core/guards/authorize-guard/authorize.guard.mjs +29 -0
- package/esm2020/src/lib/core/guards/authorize-guard/lib/core/guards/authorize-guard/public-api.mjs +7 -0
- package/esm2020/src/lib/core/guards/authorize-guard/lib/core/utils/permissions.util.mjs +15 -0
- package/esm2020/src/lib/core/guards/authorize-guard/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs +5 -0
- package/fesm2015/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs +99 -0
- package/fesm2015/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs.map +1 -0
- package/fesm2020/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs +99 -0
- package/fesm2020/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs.map +1 -0
- package/mapa-library-ui-0.43.9.tgz +0 -0
- package/package.json +9 -1
- package/src/lib/core/guards/authorize-guard/authorize.d.ts +1 -0
- package/src/lib/core/guards/authorize-guard/index.d.ts +5 -0
- package/src/lib/core/guards/authorize-guard/lib/core/enums/permissions.enum.d.ts +39 -0
- package/src/lib/core/guards/authorize-guard/lib/core/guards/authorize-guard/authorize.guard.d.ts +10 -0
- package/src/lib/core/guards/authorize-guard/lib/core/guards/authorize-guard/public-api.d.ts +3 -0
- package/src/lib/core/guards/authorize-guard/lib/core/utils/permissions.util.d.ts +5 -0
- package/mapa-library-ui-0.43.8.tgz +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of mapa-library-ui authorize
|
|
3
|
+
*/
|
|
4
|
+
export * from './lib/core/guards/authorize-guard/public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbWFwYS1saWJyYXJ5LXVpL3NyYy9hdXRob3JpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLDhDQUE4QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBtYXBhLWxpYnJhcnktdWkgYXV0aG9yaXplXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS9ndWFyZHMvYXV0aG9yaXplLWd1YXJkL3B1YmxpYy1hcGknO1xuIl19
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export var Permissions;
|
|
2
|
+
(function (Permissions) {
|
|
3
|
+
Permissions["V5CustomReportView"] = "V5CustomReportView";
|
|
4
|
+
Permissions["V5MenuMyOrganization"] = "V5MenuMyOrganization";
|
|
5
|
+
Permissions["V5CompanyViewList"] = "V5CompanyViewList";
|
|
6
|
+
Permissions["V5CompanyExportList"] = "V5CompanyExportList";
|
|
7
|
+
Permissions["V5CompanyCreateNew"] = "V5CompanyCreateNew";
|
|
8
|
+
Permissions["V5CompanyEdit"] = "V5CompanyEdit";
|
|
9
|
+
Permissions["V5CompanyView"] = "V5CompanyView";
|
|
10
|
+
Permissions["V5CompanyDelete"] = "V5CompanyDelete";
|
|
11
|
+
Permissions["V5DivisionViewList"] = "V5DivisionViewList";
|
|
12
|
+
Permissions["V5DivisionExportList"] = "V5DivisionExportList";
|
|
13
|
+
Permissions["V5DivisionCreateNew"] = "V5DivisionCreateNew";
|
|
14
|
+
Permissions["V5DivisionEdit"] = "V5DivisionEdit";
|
|
15
|
+
Permissions["V5DivisionView"] = "V5DivisionView";
|
|
16
|
+
Permissions["V5DivisionDelete"] = "V5DivisionDelete";
|
|
17
|
+
Permissions["V5UnitViewList"] = "V5UnitViewList";
|
|
18
|
+
Permissions["V5UnitExportList"] = "V5UnitExportList";
|
|
19
|
+
Permissions["V5UnitCreateNew"] = "V5UnitCreateNew";
|
|
20
|
+
Permissions["V5UnitEdit"] = "V5UnitEdit";
|
|
21
|
+
Permissions["V5UnitView"] = "V5UnitView";
|
|
22
|
+
Permissions["V5UnitDelete"] = "V5UnitDelete";
|
|
23
|
+
Permissions["V5UserViewList"] = "V5UserViewList";
|
|
24
|
+
Permissions["V5UserExportList"] = "V5UserExportList";
|
|
25
|
+
Permissions["V5UserView"] = "V5UserView";
|
|
26
|
+
Permissions["V5UserCreateNew"] = "V5UserCreateNew";
|
|
27
|
+
Permissions["V5UserEdit"] = "V5UserEdit";
|
|
28
|
+
Permissions["V5UserDelete"] = "V5UserDelete";
|
|
29
|
+
Permissions["V5MenuMyTests"] = "V5MenuMyTests";
|
|
30
|
+
Permissions["V5TestsInvitationsSend"] = "V5TestsInvitationsSend";
|
|
31
|
+
Permissions["V5TestsInvitationAndEvaluationView"] = "V5TestsInvitationAndEvaluationView";
|
|
32
|
+
Permissions["V5MenuMyReports"] = "V5MenuMyReports";
|
|
33
|
+
Permissions["V5MenuConfiguration"] = "V5MenuConfiguration";
|
|
34
|
+
Permissions["V5CustomReportCreate"] = "V5CustomReportCreate";
|
|
35
|
+
Permissions["V5ParameterizedReportCreate"] = "V5ParameterizedReportCreate";
|
|
36
|
+
Permissions["V5MenuFinancial"] = "V5MenuFinancial";
|
|
37
|
+
Permissions["V5FinancialCreditsView"] = "V5FinancialCreditsView";
|
|
38
|
+
Permissions["V5FinancialUsageExtractView"] = "V5FinancialUsageExtractView";
|
|
39
|
+
Permissions["V5FinancialInvoiceView"] = "V5FinancialInvoiceView";
|
|
40
|
+
})(Permissions || (Permissions = {}));
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG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UmVwb3J0Q3JlYXRlJyxcbiAgICBWNU1lbnVGaW5hbmNpYWwgPSAnVjVNZW51RmluYW5jaWFsJyxcbiAgICBWNUZpbmFuY2lhbENyZWRpdHNWaWV3ID0gJ1Y1RmluYW5jaWFsQ3JlZGl0c1ZpZXcnLFxuICAgIFY1RmluYW5jaWFsVXNhZ2VFeHRyYWN0VmlldyA9ICdWNUZpbmFuY2lhbFVzYWdlRXh0cmFjdFZpZXcnLFxuICAgIFY1RmluYW5jaWFsSW52b2ljZVZpZXcgPSAnVjVGaW5hbmNpYWxJbnZvaWNlVmlldydcbn0gIl19
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { getUserPermissions } from '../../utils/permissions.util';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/router";
|
|
5
|
+
export class AuthorizeGuard {
|
|
6
|
+
constructor(router) {
|
|
7
|
+
this.router = router;
|
|
8
|
+
}
|
|
9
|
+
canActivate(route, state) {
|
|
10
|
+
const requiredPermission = route.data['permission'];
|
|
11
|
+
const userPermissions = getUserPermissions();
|
|
12
|
+
if (userPermissions.includes(requiredPermission)) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.router.navigate(['/app/acesso-negado']);
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
AuthorizeGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
+
AuthorizeGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, providedIn: 'root' });
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, decorators: [{
|
|
24
|
+
type: Injectable,
|
|
25
|
+
args: [{
|
|
26
|
+
providedIn: 'root'
|
|
27
|
+
}]
|
|
28
|
+
}], ctorParameters: function () { return [{ type: i1.Router }]; } });
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXplLmd1YXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbWFwYS1saWJyYXJ5LXVpL3NyYy9saWIvY29yZS9ndWFyZHMvYXV0aG9yaXplLWd1YXJkL2F1dGhvcml6ZS5ndWFyZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRzNDLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDOzs7QUFLbEUsTUFBTSxPQUFPLGNBQWM7SUFFekIsWUFBb0IsTUFBYztRQUFkLFdBQU0sR0FBTixNQUFNLENBQVE7SUFBRyxDQUFDO0lBRXRDLFdBQVcsQ0FDVCxLQUE2QixFQUM3QixLQUEwQjtRQUUxQixNQUFNLGtCQUFrQixHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUM7UUFDcEQsTUFBTSxlQUFlLEdBQUcsa0JBQWtCLEVBQUUsQ0FBQztRQUU3QyxJQUFJLGVBQWUsQ0FBQyxRQUFRLENBQUMsa0JBQWtCLENBQUMsRUFBRTtZQUNoRCxPQUFPLElBQUksQ0FBQztTQUNiO2FBQU07WUFDTCxJQUFJLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDLG9CQUFvQixDQUFDLENBQUMsQ0FBQztZQUM3QyxPQUFPLEtBQUssQ0FBQztTQUNkO0lBQ0gsQ0F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ZFBlcm1pc3Npb24pKSB7XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhpcy5yb3V0ZXIubmF2aWdhdGUoWycvYXBwL2FjZXNzby1uZWdhZG8nXSk7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG4gIFxufVxuIl19
|
package/esm2020/src/lib/core/guards/authorize-guard/lib/core/guards/authorize-guard/public-api.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of mapa-library-ui authorize
|
|
3
|
+
*/
|
|
4
|
+
export * from './authorize.guard';
|
|
5
|
+
export * from '../../utils/permissions.util';
|
|
6
|
+
export * from '../../enums/permissions.enum';
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL21hcGEtbGlicmFyeS11aS9zcmMvbGliL2NvcmUvZ3VhcmRzL2F1dGhvcml6ZS1ndWFyZC9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyxtQkFBbUIsQ0FBQztBQUVsQyxjQUFjLDhCQUE4QixDQUFDO0FBQzdDLGNBQWMsOEJBQThCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIG1hcGEtbGlicmFyeS11aSBhdXRob3JpemVcbiAqL1xuZXhwb3J0ICogZnJvbSAnLi9hdXRob3JpemUuZ3VhcmQnO1xuXG5leHBvcnQgKiBmcm9tICcuLi8uLi91dGlscy9wZXJtaXNzaW9ucy51dGlsJztcbmV4cG9ydCAqIGZyb20gJy4uLy4uL2VudW1zL3Blcm1pc3Npb25zLmVudW0nOyJdfQ==
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function hasPermission(requiredPermission) {
|
|
2
|
+
const userPermissions = getUserPermissions();
|
|
3
|
+
return userPermissions.includes(requiredPermission);
|
|
4
|
+
}
|
|
5
|
+
export function hasAnyPermission(requiredsPermission) {
|
|
6
|
+
return requiredsPermission.some(rp => hasPermission(rp));
|
|
7
|
+
}
|
|
8
|
+
export function hasAllPermission(requiredsPermission) {
|
|
9
|
+
return requiredsPermission.every(rp => hasPermission(rp));
|
|
10
|
+
}
|
|
11
|
+
export function getUserPermissions() {
|
|
12
|
+
const permissions = localStorage.getItem('groups') || '';
|
|
13
|
+
return permissions?.split(',');
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVybWlzc2lvbnMudXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL21hcGEtbGlicmFyeS11aS9zcmMvbGliL2NvcmUvdXRpbHMvcGVybWlzc2lvbnMudXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLFVBQVUsYUFBYSxDQUFDLGtCQUErQjtJQUN6RCxNQUFNLGVBQWUsR0FBRyxrQkFBa0IsRUFBRSxDQUFDO0lBQzdDLE9BQU8sZUFBZSxDQUFDLFFBQVEsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFBO0FBQ3ZELENBQUM7QUFFRCxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsbUJBQWtDO0lBQy9ELE9BQU8sbUJBQW1CLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUE7QUFDNUQsQ0FBQztBQUVELE1BQU0sVUFBVSxnQkFBZ0IsQ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dW5jdGlvbiBnZXRVc2VyUGVybWlzc2lvbnMoKTogc3RyaW5nW10ge1xuICAgIGNvbnN0IHBlcm1pc3Npb25zID0gbG9jYWxTdG9yYWdlLmdldEl0ZW0oJ2dyb3VwcycpIHx8ICcnO1xuICAgIHJldHVybiBwZXJtaXNzaW9ucz8uc3BsaXQoJywnKVxufSJdfQ==
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './authorize';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFwYS1saWJyYXJ5LXVpLXNyYy1saWItY29yZS1ndWFyZHMtYXV0aG9yaXplLWd1YXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbWFwYS1saWJyYXJ5LXVpL3NyYy9tYXBhLWxpYnJhcnktdWktc3JjLWxpYi1jb3JlLWd1YXJkcy1hdXRob3JpemUtZ3VhcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGFBQWEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9hdXRob3JpemUnO1xuIl19
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/router';
|
|
4
|
+
|
|
5
|
+
function hasPermission(requiredPermission) {
|
|
6
|
+
const userPermissions = getUserPermissions();
|
|
7
|
+
return userPermissions.includes(requiredPermission);
|
|
8
|
+
}
|
|
9
|
+
function hasAnyPermission(requiredsPermission) {
|
|
10
|
+
return requiredsPermission.some(rp => hasPermission(rp));
|
|
11
|
+
}
|
|
12
|
+
function hasAllPermission(requiredsPermission) {
|
|
13
|
+
return requiredsPermission.every(rp => hasPermission(rp));
|
|
14
|
+
}
|
|
15
|
+
function getUserPermissions() {
|
|
16
|
+
const permissions = localStorage.getItem('groups') || '';
|
|
17
|
+
return permissions === null || permissions === void 0 ? void 0 : permissions.split(',');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class AuthorizeGuard {
|
|
21
|
+
constructor(router) {
|
|
22
|
+
this.router = router;
|
|
23
|
+
}
|
|
24
|
+
canActivate(route, state) {
|
|
25
|
+
const requiredPermission = route.data['permission'];
|
|
26
|
+
const userPermissions = getUserPermissions();
|
|
27
|
+
if (userPermissions.includes(requiredPermission)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.router.navigate(['/app/acesso-negado']);
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
AuthorizeGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
+
AuthorizeGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, providedIn: 'root' });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, decorators: [{
|
|
39
|
+
type: Injectable,
|
|
40
|
+
args: [{
|
|
41
|
+
providedIn: 'root'
|
|
42
|
+
}]
|
|
43
|
+
}], ctorParameters: function () { return [{ type: i1.Router }]; } });
|
|
44
|
+
|
|
45
|
+
var Permissions;
|
|
46
|
+
(function (Permissions) {
|
|
47
|
+
Permissions["V5CustomReportView"] = "V5CustomReportView";
|
|
48
|
+
Permissions["V5MenuMyOrganization"] = "V5MenuMyOrganization";
|
|
49
|
+
Permissions["V5CompanyViewList"] = "V5CompanyViewList";
|
|
50
|
+
Permissions["V5CompanyExportList"] = "V5CompanyExportList";
|
|
51
|
+
Permissions["V5CompanyCreateNew"] = "V5CompanyCreateNew";
|
|
52
|
+
Permissions["V5CompanyEdit"] = "V5CompanyEdit";
|
|
53
|
+
Permissions["V5CompanyView"] = "V5CompanyView";
|
|
54
|
+
Permissions["V5CompanyDelete"] = "V5CompanyDelete";
|
|
55
|
+
Permissions["V5DivisionViewList"] = "V5DivisionViewList";
|
|
56
|
+
Permissions["V5DivisionExportList"] = "V5DivisionExportList";
|
|
57
|
+
Permissions["V5DivisionCreateNew"] = "V5DivisionCreateNew";
|
|
58
|
+
Permissions["V5DivisionEdit"] = "V5DivisionEdit";
|
|
59
|
+
Permissions["V5DivisionView"] = "V5DivisionView";
|
|
60
|
+
Permissions["V5DivisionDelete"] = "V5DivisionDelete";
|
|
61
|
+
Permissions["V5UnitViewList"] = "V5UnitViewList";
|
|
62
|
+
Permissions["V5UnitExportList"] = "V5UnitExportList";
|
|
63
|
+
Permissions["V5UnitCreateNew"] = "V5UnitCreateNew";
|
|
64
|
+
Permissions["V5UnitEdit"] = "V5UnitEdit";
|
|
65
|
+
Permissions["V5UnitView"] = "V5UnitView";
|
|
66
|
+
Permissions["V5UnitDelete"] = "V5UnitDelete";
|
|
67
|
+
Permissions["V5UserViewList"] = "V5UserViewList";
|
|
68
|
+
Permissions["V5UserExportList"] = "V5UserExportList";
|
|
69
|
+
Permissions["V5UserView"] = "V5UserView";
|
|
70
|
+
Permissions["V5UserCreateNew"] = "V5UserCreateNew";
|
|
71
|
+
Permissions["V5UserEdit"] = "V5UserEdit";
|
|
72
|
+
Permissions["V5UserDelete"] = "V5UserDelete";
|
|
73
|
+
Permissions["V5MenuMyTests"] = "V5MenuMyTests";
|
|
74
|
+
Permissions["V5TestsInvitationsSend"] = "V5TestsInvitationsSend";
|
|
75
|
+
Permissions["V5TestsInvitationAndEvaluationView"] = "V5TestsInvitationAndEvaluationView";
|
|
76
|
+
Permissions["V5MenuMyReports"] = "V5MenuMyReports";
|
|
77
|
+
Permissions["V5MenuConfiguration"] = "V5MenuConfiguration";
|
|
78
|
+
Permissions["V5CustomReportCreate"] = "V5CustomReportCreate";
|
|
79
|
+
Permissions["V5ParameterizedReportCreate"] = "V5ParameterizedReportCreate";
|
|
80
|
+
Permissions["V5MenuFinancial"] = "V5MenuFinancial";
|
|
81
|
+
Permissions["V5FinancialCreditsView"] = "V5FinancialCreditsView";
|
|
82
|
+
Permissions["V5FinancialUsageExtractView"] = "V5FinancialUsageExtractView";
|
|
83
|
+
Permissions["V5FinancialInvoiceView"] = "V5FinancialInvoiceView";
|
|
84
|
+
})(Permissions || (Permissions = {}));
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
* Public API Surface of mapa-library-ui authorize
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Public API Surface of mapa-library-ui authorize
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generated bundle index. Do not edit.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
export { AuthorizeGuard, Permissions, getUserPermissions, hasAllPermission, hasAnyPermission, hasPermission };
|
|
99
|
+
//# sourceMappingURL=mapa-library-ui-src-lib-core-guards-authorize-guard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapa-library-ui-src-lib-core-guards-authorize-guard.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/utils/permissions.util.ts","../../../projects/mapa-library-ui/src/lib/core/guards/authorize-guard/authorize.guard.ts","../../../projects/mapa-library-ui/src/lib/core/enums/permissions.enum.ts","../../../projects/mapa-library-ui/src/lib/core/guards/authorize-guard/public-api.ts","../../../projects/mapa-library-ui/src/authorize.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-core-guards-authorize-guard.ts"],"sourcesContent":["import { Permissions } from \"../enums/permissions.enum\";\n\nexport function hasPermission(requiredPermission: Permissions) {\n const userPermissions = getUserPermissions();\n return userPermissions.includes(requiredPermission)\n}\n\nexport function hasAnyPermission(requiredsPermission: Permissions[]) {\n return requiredsPermission.some(rp => hasPermission(rp))\n}\n\nexport function hasAllPermission(requiredsPermission: Permissions[]) {\n return requiredsPermission.every(rp => hasPermission(rp))\n}\n\n\nexport function getUserPermissions(): string[] {\n const permissions = localStorage.getItem('groups') || '';\n return permissions?.split(',')\n}","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { getUserPermissions } from '../../utils/permissions.util';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthorizeGuard implements CanActivate {\n\n constructor(private router: Router) {}\n\n canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): boolean | Observable<boolean> | Promise<boolean> {\n const requiredPermission = route.data['permission'];\n const userPermissions = getUserPermissions();\n\n if (userPermissions.includes(requiredPermission)) {\n return true;\n } else {\n this.router.navigate(['/app/acesso-negado']);\n return false;\n }\n }\n \n}\n","export enum Permissions {\n V5CustomReportView = 'V5CustomReportView',\n V5MenuMyOrganization = 'V5MenuMyOrganization',\n V5CompanyViewList = 'V5CompanyViewList',\n V5CompanyExportList = 'V5CompanyExportList',\n V5CompanyCreateNew = 'V5CompanyCreateNew',\n V5CompanyEdit = 'V5CompanyEdit',\n V5CompanyView = 'V5CompanyView',\n V5CompanyDelete = 'V5CompanyDelete',\n V5DivisionViewList = 'V5DivisionViewList',\n V5DivisionExportList = 'V5DivisionExportList',\n V5DivisionCreateNew = 'V5DivisionCreateNew',\n V5DivisionEdit = 'V5DivisionEdit',\n V5DivisionView = 'V5DivisionView',\n V5DivisionDelete = 'V5DivisionDelete',\n V5UnitViewList = 'V5UnitViewList',\n V5UnitExportList = 'V5UnitExportList',\n V5UnitCreateNew = 'V5UnitCreateNew',\n V5UnitEdit = 'V5UnitEdit',\n V5UnitView = 'V5UnitView',\n V5UnitDelete = 'V5UnitDelete',\n V5UserViewList = 'V5UserViewList',\n V5UserExportList = 'V5UserExportList',\n V5UserView = 'V5UserView',\n V5UserCreateNew = 'V5UserCreateNew',\n V5UserEdit = 'V5UserEdit',\n V5UserDelete = 'V5UserDelete',\n V5MenuMyTests = 'V5MenuMyTests',\n V5TestsInvitationsSend = 'V5TestsInvitationsSend',\n V5TestsInvitationAndEvaluationView = 'V5TestsInvitationAndEvaluationView',\n V5MenuMyReports = 'V5MenuMyReports',\n V5MenuConfiguration = 'V5MenuConfiguration',\n V5CustomReportCreate = 'V5CustomReportCreate',\n V5ParameterizedReportCreate = 'V5ParameterizedReportCreate',\n V5MenuFinancial = 'V5MenuFinancial',\n V5FinancialCreditsView = 'V5FinancialCreditsView',\n V5FinancialUsageExtractView = 'V5FinancialUsageExtractView',\n V5FinancialInvoiceView = 'V5FinancialInvoiceView'\n} ","/*\n * Public API Surface of mapa-library-ui authorize\n */\nexport * from './authorize.guard';\n\nexport * from '../../utils/permissions.util';\nexport * from '../../enums/permissions.enum';","/*\n * Public API Surface of mapa-library-ui authorize\n */\n\nexport * from './lib/core/guards/authorize-guard/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authorize';\n"],"names":[],"mappings":";;;;AAEM,SAAU,aAAa,CAAC,kBAA+B,EAAA;AACzD,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;AAC7C,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;AACvD,CAAC;AAEK,SAAU,gBAAgB,CAAC,mBAAkC,EAAA;AAC/D,IAAA,OAAO,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC,CAAA;AAC5D,CAAC;AAEK,SAAU,gBAAgB,CAAC,mBAAkC,EAAA;AAC/D,IAAA,OAAO,mBAAmB,CA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from '@angular/router';
|
|
4
|
+
|
|
5
|
+
function hasPermission(requiredPermission) {
|
|
6
|
+
const userPermissions = getUserPermissions();
|
|
7
|
+
return userPermissions.includes(requiredPermission);
|
|
8
|
+
}
|
|
9
|
+
function hasAnyPermission(requiredsPermission) {
|
|
10
|
+
return requiredsPermission.some(rp => hasPermission(rp));
|
|
11
|
+
}
|
|
12
|
+
function hasAllPermission(requiredsPermission) {
|
|
13
|
+
return requiredsPermission.every(rp => hasPermission(rp));
|
|
14
|
+
}
|
|
15
|
+
function getUserPermissions() {
|
|
16
|
+
const permissions = localStorage.getItem('groups') || '';
|
|
17
|
+
return permissions?.split(',');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class AuthorizeGuard {
|
|
21
|
+
constructor(router) {
|
|
22
|
+
this.router = router;
|
|
23
|
+
}
|
|
24
|
+
canActivate(route, state) {
|
|
25
|
+
const requiredPermission = route.data['permission'];
|
|
26
|
+
const userPermissions = getUserPermissions();
|
|
27
|
+
if (userPermissions.includes(requiredPermission)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.router.navigate(['/app/acesso-negado']);
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
AuthorizeGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
+
AuthorizeGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, providedIn: 'root' });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizeGuard, decorators: [{
|
|
39
|
+
type: Injectable,
|
|
40
|
+
args: [{
|
|
41
|
+
providedIn: 'root'
|
|
42
|
+
}]
|
|
43
|
+
}], ctorParameters: function () { return [{ type: i1.Router }]; } });
|
|
44
|
+
|
|
45
|
+
var Permissions;
|
|
46
|
+
(function (Permissions) {
|
|
47
|
+
Permissions["V5CustomReportView"] = "V5CustomReportView";
|
|
48
|
+
Permissions["V5MenuMyOrganization"] = "V5MenuMyOrganization";
|
|
49
|
+
Permissions["V5CompanyViewList"] = "V5CompanyViewList";
|
|
50
|
+
Permissions["V5CompanyExportList"] = "V5CompanyExportList";
|
|
51
|
+
Permissions["V5CompanyCreateNew"] = "V5CompanyCreateNew";
|
|
52
|
+
Permissions["V5CompanyEdit"] = "V5CompanyEdit";
|
|
53
|
+
Permissions["V5CompanyView"] = "V5CompanyView";
|
|
54
|
+
Permissions["V5CompanyDelete"] = "V5CompanyDelete";
|
|
55
|
+
Permissions["V5DivisionViewList"] = "V5DivisionViewList";
|
|
56
|
+
Permissions["V5DivisionExportList"] = "V5DivisionExportList";
|
|
57
|
+
Permissions["V5DivisionCreateNew"] = "V5DivisionCreateNew";
|
|
58
|
+
Permissions["V5DivisionEdit"] = "V5DivisionEdit";
|
|
59
|
+
Permissions["V5DivisionView"] = "V5DivisionView";
|
|
60
|
+
Permissions["V5DivisionDelete"] = "V5DivisionDelete";
|
|
61
|
+
Permissions["V5UnitViewList"] = "V5UnitViewList";
|
|
62
|
+
Permissions["V5UnitExportList"] = "V5UnitExportList";
|
|
63
|
+
Permissions["V5UnitCreateNew"] = "V5UnitCreateNew";
|
|
64
|
+
Permissions["V5UnitEdit"] = "V5UnitEdit";
|
|
65
|
+
Permissions["V5UnitView"] = "V5UnitView";
|
|
66
|
+
Permissions["V5UnitDelete"] = "V5UnitDelete";
|
|
67
|
+
Permissions["V5UserViewList"] = "V5UserViewList";
|
|
68
|
+
Permissions["V5UserExportList"] = "V5UserExportList";
|
|
69
|
+
Permissions["V5UserView"] = "V5UserView";
|
|
70
|
+
Permissions["V5UserCreateNew"] = "V5UserCreateNew";
|
|
71
|
+
Permissions["V5UserEdit"] = "V5UserEdit";
|
|
72
|
+
Permissions["V5UserDelete"] = "V5UserDelete";
|
|
73
|
+
Permissions["V5MenuMyTests"] = "V5MenuMyTests";
|
|
74
|
+
Permissions["V5TestsInvitationsSend"] = "V5TestsInvitationsSend";
|
|
75
|
+
Permissions["V5TestsInvitationAndEvaluationView"] = "V5TestsInvitationAndEvaluationView";
|
|
76
|
+
Permissions["V5MenuMyReports"] = "V5MenuMyReports";
|
|
77
|
+
Permissions["V5MenuConfiguration"] = "V5MenuConfiguration";
|
|
78
|
+
Permissions["V5CustomReportCreate"] = "V5CustomReportCreate";
|
|
79
|
+
Permissions["V5ParameterizedReportCreate"] = "V5ParameterizedReportCreate";
|
|
80
|
+
Permissions["V5MenuFinancial"] = "V5MenuFinancial";
|
|
81
|
+
Permissions["V5FinancialCreditsView"] = "V5FinancialCreditsView";
|
|
82
|
+
Permissions["V5FinancialUsageExtractView"] = "V5FinancialUsageExtractView";
|
|
83
|
+
Permissions["V5FinancialInvoiceView"] = "V5FinancialInvoiceView";
|
|
84
|
+
})(Permissions || (Permissions = {}));
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
* Public API Surface of mapa-library-ui authorize
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Public API Surface of mapa-library-ui authorize
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generated bundle index. Do not edit.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
export { AuthorizeGuard, Permissions, getUserPermissions, hasAllPermission, hasAnyPermission, hasPermission };
|
|
99
|
+
//# sourceMappingURL=mapa-library-ui-src-lib-core-guards-authorize-guard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapa-library-ui-src-lib-core-guards-authorize-guard.mjs","sources":["../../../projects/mapa-library-ui/src/lib/core/utils/permissions.util.ts","../../../projects/mapa-library-ui/src/lib/core/guards/authorize-guard/authorize.guard.ts","../../../projects/mapa-library-ui/src/lib/core/enums/permissions.enum.ts","../../../projects/mapa-library-ui/src/lib/core/guards/authorize-guard/public-api.ts","../../../projects/mapa-library-ui/src/authorize.ts","../../../projects/mapa-library-ui/src/mapa-library-ui-src-lib-core-guards-authorize-guard.ts"],"sourcesContent":["import { Permissions } from \"../enums/permissions.enum\";\n\nexport function hasPermission(requiredPermission: Permissions) {\n const userPermissions = getUserPermissions();\n return userPermissions.includes(requiredPermission)\n}\n\nexport function hasAnyPermission(requiredsPermission: Permissions[]) {\n return requiredsPermission.some(rp => hasPermission(rp))\n}\n\nexport function hasAllPermission(requiredsPermission: Permissions[]) {\n return requiredsPermission.every(rp => hasPermission(rp))\n}\n\n\nexport function getUserPermissions(): string[] {\n const permissions = localStorage.getItem('groups') || '';\n return permissions?.split(',')\n}","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { getUserPermissions } from '../../utils/permissions.util';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthorizeGuard implements CanActivate {\n\n constructor(private router: Router) {}\n\n canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): boolean | Observable<boolean> | Promise<boolean> {\n const requiredPermission = route.data['permission'];\n const userPermissions = getUserPermissions();\n\n if (userPermissions.includes(requiredPermission)) {\n return true;\n } else {\n this.router.navigate(['/app/acesso-negado']);\n return false;\n }\n }\n \n}\n","export enum Permissions {\n V5CustomReportView = 'V5CustomReportView',\n V5MenuMyOrganization = 'V5MenuMyOrganization',\n V5CompanyViewList = 'V5CompanyViewList',\n V5CompanyExportList = 'V5CompanyExportList',\n V5CompanyCreateNew = 'V5CompanyCreateNew',\n V5CompanyEdit = 'V5CompanyEdit',\n V5CompanyView = 'V5CompanyView',\n V5CompanyDelete = 'V5CompanyDelete',\n V5DivisionViewList = 'V5DivisionViewList',\n V5DivisionExportList = 'V5DivisionExportList',\n V5DivisionCreateNew = 'V5DivisionCreateNew',\n V5DivisionEdit = 'V5DivisionEdit',\n V5DivisionView = 'V5DivisionView',\n V5DivisionDelete = 'V5DivisionDelete',\n V5UnitViewList = 'V5UnitViewList',\n V5UnitExportList = 'V5UnitExportList',\n V5UnitCreateNew = 'V5UnitCreateNew',\n V5UnitEdit = 'V5UnitEdit',\n V5UnitView = 'V5UnitView',\n V5UnitDelete = 'V5UnitDelete',\n V5UserViewList = 'V5UserViewList',\n V5UserExportList = 'V5UserExportList',\n V5UserView = 'V5UserView',\n V5UserCreateNew = 'V5UserCreateNew',\n V5UserEdit = 'V5UserEdit',\n V5UserDelete = 'V5UserDelete',\n V5MenuMyTests = 'V5MenuMyTests',\n V5TestsInvitationsSend = 'V5TestsInvitationsSend',\n V5TestsInvitationAndEvaluationView = 'V5TestsInvitationAndEvaluationView',\n V5MenuMyReports = 'V5MenuMyReports',\n V5MenuConfiguration = 'V5MenuConfiguration',\n V5CustomReportCreate = 'V5CustomReportCreate',\n V5ParameterizedReportCreate = 'V5ParameterizedReportCreate',\n V5MenuFinancial = 'V5MenuFinancial',\n V5FinancialCreditsView = 'V5FinancialCreditsView',\n V5FinancialUsageExtractView = 'V5FinancialUsageExtractView',\n V5FinancialInvoiceView = 'V5FinancialInvoiceView'\n} ","/*\n * Public API Surface of mapa-library-ui authorize\n */\nexport * from './authorize.guard';\n\nexport * from '../../utils/permissions.util';\nexport * from '../../enums/permissions.enum';","/*\n * Public API Surface of mapa-library-ui authorize\n */\n\nexport * from './lib/core/guards/authorize-guard/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authorize';\n"],"names":[],"mappings":";;;;AAEM,SAAU,aAAa,CAAC,kBAA+B,EAAA;AACzD,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;AAC7C,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;AACvD,CAAC;AAEK,SAAU,gBAAgB,CAAC,mBAAkC,EAAA;AAC/D,IAAA,OAAO,mB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ANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mapa-library-ui",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^15.2.0",
|
|
6
6
|
"@angular/core": "^15.2.0"
|
|
@@ -226,6 +226,14 @@
|
|
|
226
226
|
"es2015": "./fesm2015/mapa-library-ui-src-lib-components-warning.mjs",
|
|
227
227
|
"node": "./fesm2015/mapa-library-ui-src-lib-components-warning.mjs",
|
|
228
228
|
"default": "./fesm2020/mapa-library-ui-src-lib-components-warning.mjs"
|
|
229
|
+
},
|
|
230
|
+
"./src/lib/core/guards/authorize-guard": {
|
|
231
|
+
"types": "./src/lib/core/guards/authorize-guard/index.d.ts",
|
|
232
|
+
"esm2020": "./esm2020/src/lib/core/guards/authorize-guard/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs",
|
|
233
|
+
"es2020": "./fesm2020/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs",
|
|
234
|
+
"es2015": "./fesm2015/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs",
|
|
235
|
+
"node": "./fesm2015/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs",
|
|
236
|
+
"default": "./fesm2020/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs"
|
|
229
237
|
}
|
|
230
238
|
}
|
|
231
239
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/core/guards/authorize-guard/public-api';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare enum Permissions {
|
|
2
|
+
V5CustomReportView = "V5CustomReportView",
|
|
3
|
+
V5MenuMyOrganization = "V5MenuMyOrganization",
|
|
4
|
+
V5CompanyViewList = "V5CompanyViewList",
|
|
5
|
+
V5CompanyExportList = "V5CompanyExportList",
|
|
6
|
+
V5CompanyCreateNew = "V5CompanyCreateNew",
|
|
7
|
+
V5CompanyEdit = "V5CompanyEdit",
|
|
8
|
+
V5CompanyView = "V5CompanyView",
|
|
9
|
+
V5CompanyDelete = "V5CompanyDelete",
|
|
10
|
+
V5DivisionViewList = "V5DivisionViewList",
|
|
11
|
+
V5DivisionExportList = "V5DivisionExportList",
|
|
12
|
+
V5DivisionCreateNew = "V5DivisionCreateNew",
|
|
13
|
+
V5DivisionEdit = "V5DivisionEdit",
|
|
14
|
+
V5DivisionView = "V5DivisionView",
|
|
15
|
+
V5DivisionDelete = "V5DivisionDelete",
|
|
16
|
+
V5UnitViewList = "V5UnitViewList",
|
|
17
|
+
V5UnitExportList = "V5UnitExportList",
|
|
18
|
+
V5UnitCreateNew = "V5UnitCreateNew",
|
|
19
|
+
V5UnitEdit = "V5UnitEdit",
|
|
20
|
+
V5UnitView = "V5UnitView",
|
|
21
|
+
V5UnitDelete = "V5UnitDelete",
|
|
22
|
+
V5UserViewList = "V5UserViewList",
|
|
23
|
+
V5UserExportList = "V5UserExportList",
|
|
24
|
+
V5UserView = "V5UserView",
|
|
25
|
+
V5UserCreateNew = "V5UserCreateNew",
|
|
26
|
+
V5UserEdit = "V5UserEdit",
|
|
27
|
+
V5UserDelete = "V5UserDelete",
|
|
28
|
+
V5MenuMyTests = "V5MenuMyTests",
|
|
29
|
+
V5TestsInvitationsSend = "V5TestsInvitationsSend",
|
|
30
|
+
V5TestsInvitationAndEvaluationView = "V5TestsInvitationAndEvaluationView",
|
|
31
|
+
V5MenuMyReports = "V5MenuMyReports",
|
|
32
|
+
V5MenuConfiguration = "V5MenuConfiguration",
|
|
33
|
+
V5CustomReportCreate = "V5CustomReportCreate",
|
|
34
|
+
V5ParameterizedReportCreate = "V5ParameterizedReportCreate",
|
|
35
|
+
V5MenuFinancial = "V5MenuFinancial",
|
|
36
|
+
V5FinancialCreditsView = "V5FinancialCreditsView",
|
|
37
|
+
V5FinancialUsageExtractView = "V5FinancialUsageExtractView",
|
|
38
|
+
V5FinancialInvoiceView = "V5FinancialInvoiceView"
|
|
39
|
+
}
|
package/src/lib/core/guards/authorize-guard/lib/core/guards/authorize-guard/authorize.guard.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class AuthorizeGuard implements CanActivate {
|
|
5
|
+
private router;
|
|
6
|
+
constructor(router: Router);
|
|
7
|
+
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Observable<boolean> | Promise<boolean>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthorizeGuard, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthorizeGuard>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Permissions } from "../enums/permissions.enum";
|
|
2
|
+
export declare function hasPermission(requiredPermission: Permissions): boolean;
|
|
3
|
+
export declare function hasAnyPermission(requiredsPermission: Permissions[]): boolean;
|
|
4
|
+
export declare function hasAllPermission(requiredsPermission: Permissions[]): boolean;
|
|
5
|
+
export declare function getUserPermissions(): string[];
|
|
Binary file
|