tnx-shared 5.1.302 → 5.1.305
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/bundles/tnx-shared.umd.js +53 -2
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/components/common-app-component/common-app-component.d.ts +3 -3
- package/components/common-app-component/common-app-component.d.ts.map +1 -1
- package/esm2015/components/common-app-component/common-app-component.js +5 -5
- package/esm2015/services/permission.service.js +7 -5
- package/esm2015/services/role.service.js +29 -1
- package/fesm2015/tnx-shared.js +34 -4
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/services/permission.service.d.ts +2 -2
- package/services/permission.service.d.ts.map +1 -1
- package/services/role.service.d.ts +7 -0
- package/services/role.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -11099,7 +11099,7 @@
|
|
|
11099
11099
|
var url = this.serviceUri + "/GetCurrentUserPermission";
|
|
11100
11100
|
return this.defaultGet(url);
|
|
11101
11101
|
};
|
|
11102
|
-
PermissionService.prototype.getAllBasePermission = function () {
|
|
11102
|
+
PermissionService.prototype.getAllBasePermission = function (userId) {
|
|
11103
11103
|
var _a, _b, _c, _d;
|
|
11104
11104
|
return __awaiter(this, void 0, void 0, function () {
|
|
11105
11105
|
var url, user, res, lstAppCodes, promiseArr, code, service, permissions, key, storageItem;
|
|
@@ -11113,6 +11113,10 @@
|
|
|
11113
11113
|
|| (user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin)) {
|
|
11114
11114
|
return [2 /*return*/];
|
|
11115
11115
|
}
|
|
11116
|
+
if (userId && userId != '' && userId != this._commonService.guidEmpty()) {
|
|
11117
|
+
url += "?userId=" + userId;
|
|
11118
|
+
return [2 /*return*/, this.defaultGet(url)];
|
|
11119
|
+
}
|
|
11116
11120
|
return [4 /*yield*/, this.defaultGet(url)];
|
|
11117
11121
|
case 1:
|
|
11118
11122
|
res = _e.sent();
|
|
@@ -11264,7 +11268,26 @@
|
|
|
11264
11268
|
case 0: return [4 /*yield*/, this._userService.getCurrentUser()];
|
|
11265
11269
|
case 1:
|
|
11266
11270
|
user = (_e.sent());
|
|
11267
|
-
|
|
11271
|
+
if (user && user.issuperuser && user.issuperuser.toLowerCase() == 'true') {
|
|
11272
|
+
resolve(true);
|
|
11273
|
+
return [2 /*return*/];
|
|
11274
|
+
}
|
|
11275
|
+
if (user && user.isadmin && user.isadmin.toLowerCase() == 'true' && !this.ignoreAdmin) {
|
|
11276
|
+
resolve(true);
|
|
11277
|
+
return [2 /*return*/];
|
|
11278
|
+
}
|
|
11279
|
+
this.getPermissions(service).then(function (permissions) {
|
|
11280
|
+
if (permissions && permissions.length) {
|
|
11281
|
+
var isAuthorized = permissions.includes(permission);
|
|
11282
|
+
resolve(isAuthorized);
|
|
11283
|
+
}
|
|
11284
|
+
else {
|
|
11285
|
+
console.log("L\u1ED7i kh\u00F4ng l\u1EA5y \u0111\u01B0\u1EE3c permission cho module: " + service);
|
|
11286
|
+
resolve(false);
|
|
11287
|
+
}
|
|
11288
|
+
}, function (error) {
|
|
11289
|
+
reject(false);
|
|
11290
|
+
});
|
|
11268
11291
|
return [2 /*return*/];
|
|
11269
11292
|
}
|
|
11270
11293
|
});
|
|
@@ -35621,6 +35644,34 @@
|
|
|
35621
35644
|
_this._moduleConfig = _moduleConfigService.getConfig();
|
|
35622
35645
|
return _this;
|
|
35623
35646
|
}
|
|
35647
|
+
RoleService.prototype.getDetailCustom = function (id, pid) {
|
|
35648
|
+
var url = this.serviceUri + "/GetDetailCustom/" + id + "?pid=" + pid;
|
|
35649
|
+
return this.defaultGet(url);
|
|
35650
|
+
};
|
|
35651
|
+
RoleService.prototype.GetIdByUsers = function (model) {
|
|
35652
|
+
var url = this.serviceUri + "/GetIdByUsers";
|
|
35653
|
+
return this.defaultPost(url, model);
|
|
35654
|
+
};
|
|
35655
|
+
RoleService.prototype.GetIdByGroupUsers = function (model) {
|
|
35656
|
+
var url = this.serviceUri + "/GetIdByGroupUsers";
|
|
35657
|
+
return this.defaultPost(url, model);
|
|
35658
|
+
};
|
|
35659
|
+
RoleService.prototype.GetIntersectIdByGroupUsers = function (userIds) {
|
|
35660
|
+
var url = this.serviceUri + "/GetIntersectIdByGroupUsers";
|
|
35661
|
+
return this.defaultPost(url, userIds);
|
|
35662
|
+
};
|
|
35663
|
+
RoleService.prototype.GetIntersectDirectIdByGroupUsers = function (userIds) {
|
|
35664
|
+
var url = this.serviceUri + "/GetIntersectDirectIdByGroupUsers";
|
|
35665
|
+
return this.defaultPost(url, userIds);
|
|
35666
|
+
};
|
|
35667
|
+
RoleService.prototype.GetIntersectIdByUsers = function (userIds) {
|
|
35668
|
+
var url = this.serviceUri + "/GetIntersectIdByUsers";
|
|
35669
|
+
return this.defaultPost(url, userIds);
|
|
35670
|
+
};
|
|
35671
|
+
RoleService.prototype.GetIntersectDirectIdByUsers = function (userIds) {
|
|
35672
|
+
var url = this.serviceUri + "/GetIntersectDirectIdByUsers";
|
|
35673
|
+
return this.defaultPost(url, userIds);
|
|
35674
|
+
};
|
|
35624
35675
|
return RoleService;
|
|
35625
35676
|
}(BaseService));
|
|
35626
35677
|
RoleService.ɵprov = i0.ɵɵdefineInjectable({ factory: function RoleService_Factory() { return new RoleService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(ModuleConfigService)); }, token: RoleService, providedIn: "root" });
|