bruce-models 0.3.5 → 0.3.7
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/bruce-models.es5.js +15 -6
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +15 -6
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/user/session.js +15 -6
- package/dist/lib/user/session.js.map +1 -1
- package/dist/types/user/session.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -4871,19 +4871,28 @@
|
|
|
4871
4871
|
}
|
|
4872
4872
|
Session.Logout = Logout;
|
|
4873
4873
|
function IsPermEnabled(session, accountId, perm) {
|
|
4874
|
-
var _a;
|
|
4874
|
+
var _a, _b;
|
|
4875
4875
|
if (!perm) {
|
|
4876
4876
|
throw ("Perm is required.");
|
|
4877
4877
|
}
|
|
4878
4878
|
perm = perm.toLocaleUpperCase();
|
|
4879
|
-
var
|
|
4880
|
-
if (!
|
|
4879
|
+
var perms = (_b = (_a = session === null || session === void 0 ? void 0 : session.User) === null || _a === void 0 ? void 0 : _a.AccessPermissions) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x["ClientAccount.ID"] == accountId; });
|
|
4880
|
+
if (!perms) {
|
|
4881
4881
|
return false;
|
|
4882
4882
|
}
|
|
4883
|
-
if (!
|
|
4884
|
-
|
|
4883
|
+
if (!perms.UserGroups) {
|
|
4884
|
+
perms.UserGroups = [];
|
|
4885
|
+
}
|
|
4886
|
+
for (var i = 0; i < perms.UserGroups.length; i++) {
|
|
4887
|
+
var group = perms.UserGroups[i];
|
|
4888
|
+
if (typeof group != "string") {
|
|
4889
|
+
var features = group.Features;
|
|
4890
|
+
if (features && features.findIndex(function (x) { return x.toLocaleUpperCase() == perm; }) > -1) {
|
|
4891
|
+
return true;
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4885
4894
|
}
|
|
4886
|
-
return
|
|
4895
|
+
return false;
|
|
4887
4896
|
}
|
|
4888
4897
|
Session.IsPermEnabled = IsPermEnabled;
|
|
4889
4898
|
function IsSuperPermEnabled(session, perm) {
|