@bigbinary/neeto-molecules 1.0.46 → 1.0.47

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,18 @@ 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 filterByPermission = ramda.curry(function (_ref2) {
32106
+ var permission = _ref2.permission;
32107
+ return permission ? initializers.globalProps.permissions.includes(permission) : true;
32108
+ });
32104
32109
  return /*#__PURE__*/React__default["default"].createElement("div", {
32105
32110
  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);
32111
+ }, navLinks.filter(filterByPermission).map(function (_ref3, mainIndex) {
32112
+ var label = _ref3.label,
32113
+ to = _ref3.to,
32114
+ icon = _ref3.icon,
32115
+ description = _ref3.description,
32116
+ otherProps = _objectWithoutProperties(_ref3, _excluded);
32112
32117
  var IconSVG = icon;
32113
32118
  var url = new URL(to, window.location.href);
32114
32119
  var isActive = function isActive() {