@bigbinary/neeto-molecules 1.0.46 → 1.0.48

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.
@@ -12,6 +12,7 @@ var i18next = require('i18next');
12
12
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
13
13
  var KeyboardShortcuts = require('@bigbinary/neeto-molecules/KeyboardShortcuts');
14
14
  var ProductLogos = require('@bigbinary/neeto-icons/logos');
15
+ var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
15
16
 
16
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
18
 
@@ -32101,14 +32102,21 @@ var _excluded = ["label", "to", "icon", "description"];
32101
32102
  var Links = function Links(_ref) {
32102
32103
  var navLinks = _ref.navLinks;
32103
32104
  var location = reactRouterDom.useLocation();
32105
+ var filterByPermissions = ramda.curry(function (_ref2) {
32106
+ var permissions = _ref2.permissions;
32107
+ if (permissions) {
32108
+ return ramda.is(Array, permissions) ? permissions.some(ramda.includes(ramda.__, initializers.globalProps.permissions)) : initializers.globalProps.permissions.includes(permissions);
32109
+ }
32110
+ return true;
32111
+ });
32104
32112
  return /*#__PURE__*/React__default["default"].createElement("div", {
32105
32113
  className: "neeto-molecules-sidebar__links"
32106
- }, navLinks.map(function (_ref2, mainIndex) {
32107
- var label = _ref2.label,
32108
- to = _ref2.to,
32109
- icon = _ref2.icon,
32110
- description = _ref2.description,
32111
- otherProps = _objectWithoutProperties(_ref2, _excluded);
32114
+ }, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
32115
+ var label = _ref3.label,
32116
+ to = _ref3.to,
32117
+ icon = _ref3.icon,
32118
+ description = _ref3.description,
32119
+ otherProps = _objectWithoutProperties(_ref3, _excluded);
32112
32120
  var IconSVG = icon;
32113
32121
  var url = new URL(to, window.location.href);
32114
32122
  var isActive = function isActive() {