Skip to content

Commit

Permalink
SecuredByRole fails if app roles are not loaded (#3753)
Browse files Browse the repository at this point in the history
Fixes #3752
  • Loading branch information
marrobi authored Oct 18, 2023
1 parent 984c76e commit 80e5268
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ENHANCEMENTS:
BUG FIXES:
* Upgrade porter version to v1.0.15 and on error getting porter outputs return dict ([#3744](https://github.com/microsoft/AzureTRE/issues/3744))
* Fix notifications displaying workspace name rather than actual resource ([#3746](https://github.com/microsoft/AzureTRE/issues/3746))
* Fix SecuredByRole fails if app roles are not loaded ([#3752](https://github.com/microsoft/AzureTRE/issues/3752))

COMPONENTS:

Expand Down
2 changes: 1 addition & 1 deletion ui/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tre-ui",
"version": "0.5.12",
"version": "0.5.14",
"private": true,
"dependencies": {
"@azure/msal-browser": "^2.35.0",
Expand Down
2 changes: 1 addition & 1 deletion ui/app/src/components/shared/SecuredByRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const SecuredByRole: React.FunctionComponent<SecuredByRoleProps> = (props
}, [apiCall, workspaceCtx.workspace.id, props.workspaceId, workspaceCtx.roles]);

return (
((workspaceRoles && workspaceRoles.some(x => props.allowedWorkspaceRoles?.includes(x))) || (appRoles && appRoles.roles.some(x => props.allowedAppRoles?.includes(x))))
(workspaceRoles?.some(x => props.allowedWorkspaceRoles?.includes(x)) || appRoles?.roles?.some(x => props.allowedAppRoles?.includes(x)))
? props.element
: (props.errorString && (workspaceRoles.length > 0 || appRoles.roles.length > 0)
? <MessageBar messageBarType={MessageBarType.error} isMultiline={true}>
Expand Down

0 comments on commit 80e5268

Please sign in to comment.