Skip to content

Commit

Permalink
[6158] PermittedRoles is not working for widget PublishingStatusButton
Browse files Browse the repository at this point in the history
  • Loading branch information
rart committed Jul 18, 2023
1 parent 19595db commit 3068dd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/app/src/components/Widget/renderWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function renderWidgets(
? widgets
.filter(
(widget) =>
!Array.isArray(widget.permittedRoles) ||
(widget.permittedRoles ?? []).length === 0 ||
(userRoles ?? []).some((role) => widget.permittedRoles.includes(role))
)
Expand Down
2 changes: 1 addition & 1 deletion ui/app/src/state/reducers/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const reducer = createReducer<GlobalState['preview']>(initialState, {
middleSection: { widgets: [] },
rightSection: { widgets: [] }
};
const arrays = ['widgets'];
const arrays = ['widgets', 'permittedRoles'];
const configDOM = fromString(payload.configXml);
const toolbar = configDOM.querySelector('[id="craftercms.components.PreviewToolbar"] > configuration');

Expand Down

0 comments on commit 3068dd4

Please sign in to comment.