transcend-react-legacy
Advanced tools
Comparing version 1.7.4 to 1.7.5
@@ -66,5 +66,7 @@ 'use strict'; | ||
}), _defineProperty(_PermissionFlags, _ApplicationProducts2.default.newport, { | ||
read: 0x8, | ||
write: 0x10, | ||
manage: 0x20 | ||
access: 0x400, | ||
createReports: 0x800, | ||
createSchedules: 0x1000, | ||
runReports: 0x2000, | ||
publishReports: 0x4000 | ||
}), _defineProperty(_PermissionFlags, _ApplicationProducts2.default.uhf, { | ||
@@ -99,5 +101,11 @@ read: 0x200, | ||
createAlerts: 'Manage alerts' | ||
}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.newport, {}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.uhf, {}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.gutenberg, {}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.smithers, {}), _PermissionNames); | ||
}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.newport, { | ||
createReports: 'Manage reports', | ||
createSchedules: 'Manage schedules', | ||
runReports: 'Run reports', | ||
publishReports: 'Publish reports' | ||
}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.uhf, {}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.gutenberg, {}), _defineProperty(_PermissionNames, _ApplicationProducts2.default.smithers, {}), _PermissionNames); | ||
var LegacyApps = exports.LegacyApps = (_LegacyApps = {}, _defineProperty(_LegacyApps, _ApplicationProducts2.default.newport, true), _defineProperty(_LegacyApps, _ApplicationProducts2.default.uhf, true), _defineProperty(_LegacyApps, _ApplicationProducts2.default.gutenberg, true), _defineProperty(_LegacyApps, _ApplicationProducts2.default.smithers, true), _LegacyApps); | ||
// NOTE: we can get rid of that dictionary once all the apps are migrated | ||
var LegacyApps = exports.LegacyApps = (_LegacyApps = {}, _defineProperty(_LegacyApps, _ApplicationProducts2.default.uhf, true), _defineProperty(_LegacyApps, _ApplicationProducts2.default.gutenberg, true), _defineProperty(_LegacyApps, _ApplicationProducts2.default.smithers, true), _LegacyApps); | ||
@@ -183,5 +191,28 @@ var Permissions = function () { | ||
return !bitwise.test(PermissionFlags[product].write, this.accessMask) && !bitwise.test(PermissionFlags[product].manage, this.accessMask); | ||
var accessMask = _lodash2.default.isUndefined(customAccessMask) ? this.accessMask : customAccessMask; | ||
return !bitwise.test(PermissionFlags[product].write, accessMask) && !bitwise.test(PermissionFlags[product].manage, accessMask); | ||
} | ||
}, { | ||
key: 'hasNoAccess', | ||
value: function hasNoAccess(productName, customAccessMask) { | ||
if (this.isSuperAdmin(customAccessMask) || this.isAgencyAdmin(customAccessMask)) { | ||
return false; | ||
} | ||
var product = (productName || _Application2.default.currentProduct).toLowerCase(); | ||
if (!_ApplicationProducts2.default[product]) { | ||
return true; | ||
} | ||
if (!LegacyApps[product]) { | ||
var productPermissions = this.getProductPermissionFlags(productName, customAccessMask); | ||
return !Object.keys(productPermissions).find(function (key) { | ||
return productPermissions[key]; | ||
}); | ||
} | ||
var accessMask = _lodash2.default.isUndefined(customAccessMask) ? this.accessMask : customAccessMask; | ||
return !bitwise.test(PermissionFlags[product].read, accessMask) && !bitwise.test(PermissionFlags[product].write, accessMask) && !bitwise.test(PermissionFlags[product].manage, accessMask); | ||
} | ||
/** | ||
@@ -188,0 +219,0 @@ * Returns true if specified product is read only for the current user; otherwise, false. |
{ | ||
"name": "transcend-react-legacy", | ||
"version": "1.7.4", | ||
"version": "1.7.5", | ||
"description": "LEGACY Transcend-react is a component library for NUVI", | ||
@@ -5,0 +5,0 @@ "main": "lib/main", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294153
6591