Skip to content

Commit

Permalink
Merge pull request #1406 from folio-org/STCOR-800
Browse files Browse the repository at this point in the history
STCOR-800 Show app/record when you have permission for that
  • Loading branch information
Dmitriy-Litvinenko authored Jan 30, 2024
2 parents f886643 + 3597313 commit 18302ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Add arial-label for `ProfileDropdown.js`. Refs STCOR-753.
* Upgrade, configure stylelint. Refs STCOR-799.
* Move `localforage.clear()` to `afterEach` for test suite. Refs STCOR-801.
* Show app/record when you have permission for that. Refs STCOR-800.

## [10.0.0](https://github.com/folio-org/stripes-core/tree/v10.0.0) (2023-10-11)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v9.0.0...v10.0.0)
Expand Down
6 changes: 5 additions & 1 deletion src/moduleRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ function ModuleRoutes({ stripes }) {
);
}

const currentModule = modules.app.find(module => location.pathname.startsWith(`${module.route}`));
const currentModule = modules.app.find(module => {
const SEPARATOR = '/';

return `${SEPARATOR}${location.pathname.split(SEPARATOR)[1]}` === module.route;
});
const moduleName = currentModule?.module?.replace(packageName.PACKAGE_SCOPE_REGEX, '');

if (!stripes.hasPerm(`module.${moduleName}.enabled`)) {
Expand Down

0 comments on commit 18302ae

Please sign in to comment.