Error when accessing Runbooks without properly scoped permissions
Team
- [X] I've assigned a team label to this issue
Severity
1 customer
Version
2020.6.4671
Latest Version
I could reproduce the problem in the latest build
What happened?
A user receives a "TypeError: Cannot read properties of undefined (reading 'Name')" error when accessing Runbooks if the runbook has been deployed to a tenant that the user doesn't have permissions to.

Reproduction
Deploy a Runbook to TenantA. Configure a user's permissions so they do not have the 'RunBookRunView' permission for TenantA.
Error and Stacktrace
An unexpected error occurred in Octopus v2022.1.2342: "TypeError: Cannot read properties of undefined (reading 'Name')"
in RunbookOverviewLayoutInternal
in WithProjectContext
in WithRunbookContext
in Unknown
in Page
in p
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in Unknown
in RenderWithPage
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in RunbookContextProvider
in RunbookContextLayout
in withRouter(RunbookContextLayout)
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in RunbookRoutes
in withRouter(RunbookRoutes)
in t
in OperationsRoute
in withRouter(OperationsRoute)
in t
in ErrorBoundaryInternal
in RouteAwareErrorBoundary
in div
in div
in Unknown
in t
in Unknown
in MediaQuery
in div
in NavigationSidebarLayout
in withRouter(NavigationSidebarLayout)
in main
in ProjectContextProvider
in ProjectLayoutInternal
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in Unknown
in SlugSafeRedirect
in withRouter(SlugSafeRedirect)
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in ProjectRoutes
in n
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in t
in RootRoutes
in withRouter(RootRoutes)
in SpaceLoader
in WithPersistedSpace
in p
in withRouter(Connect(WithPersistedSpace))
in div
in StandardLayoutInternal
in p
in t
in ErrorBoundaryInternal
in ReloadableRoute
in SecureRoute
in t
in Unknown
in Unknown
in t
in t
in Unknown
in DevToolsContextProvider
in ClientConnector
in W
in t
in Unknown
in h
in Unknown
in p
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in ErrorBoundaryInternal
in c
in App
More Information
No response
Workaround
Update the user so they have 'RunBookRunView' for any tenant the Runbook has been deployed to.
Client report: https://help.octopus.com/t/javascript-error-viewing-runbook-overview/27871
We should filter out the runbacks for the tenants they can't see and show an error and only allow them to see the runbacks for the tenants that they have permission to see. 1 customer issue for now - low priority.
Unable to reproduce from 2023.1