Skip to content

Commit

Permalink
UIREQ-1187 - Update permission checks of ui-users (#1228)
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko committed Nov 22, 2024
1 parent d45af98 commit c3baa1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@
"@babel/plugin-transform-runtime": "^7.13.10",
"@folio/eslint-config-stripes": "^7.0.0",
"@folio/jest-config-stripes": "^2.0.0",
"@folio/stripes": "^9.0.0",
"@folio/stripes": "^9.2.5",
"@folio/stripes-cli": "^3.0.0",
"@folio/stripes-components": "^12.0.0",
"@folio/stripes-core": "^10.0.0",
"@folio/stripes-core": "^10.2.3",
"@folio/stripes-testing": "^4.4.0",
"@formatjs/cli": "^6.1.3",
"core-js": "^3.6.4",
Expand Down Expand Up @@ -202,7 +202,7 @@
"react-to-print": "^2.9.0"
},
"peerDependencies": {
"@folio/stripes": "^9.0.0",
"@folio/stripes": "^9.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.4.4",
Expand Down
6 changes: 3 additions & 3 deletions src/PatronBlockModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Modal,
Row
} from '@folio/stripes/components';
import { IfPermission } from '@folio/stripes/core';
import { IfAnyPermission } from '@folio/stripes/core';

const PatronBlockModal = ({
open,
Expand Down Expand Up @@ -55,14 +55,14 @@ const PatronBlockModal = ({
<Col xs={6}>
<Row end="xs">
<Col>
<IfPermission perm="ui-users.overridePatronBlock">
<IfAnyPermission perm="ui-users.overridePatronBlock,ui-users.override-patron-block.execute">
<Button
data-test-override-patron-block
onClick={onOverride}
>
<FormattedMessage id="ui-requests.override" />
</Button>
</IfPermission>
</IfAnyPermission>
<Button onClick={onClose}>
<FormattedMessage id="ui-requests.close" />
</Button>
Expand Down
1 change: 1 addition & 0 deletions test/jest/__mock__/stripesCore.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jest.mock('@folio/stripes/core', () => ({
);
}),
IfPermission: jest.fn(({ children }) => <div>{children}</div>),
IfAnyPermission: jest.fn(({ children }) => <div>{children}</div>),
TitleManager: jest.fn(jest.fn(() => null)),
AppIcon: jest.fn(({ children }) => <div>{children}</div>),
}));

0 comments on commit c3baa1f

Please sign in to comment.