This is an automated email from the ASF dual-hosted git repository. hugh pushed a commit to branch hugh/rbac-2 in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7b8ffaf948e3a608c27848d578a9f54dffa8610c Author: hughhhh <[email protected]> AuthorDate: Tue Aug 31 11:47:28 2021 -0700 fix test --- superset-frontend/src/components/Menu/Menu.test.tsx | 9 +++++++++ superset-frontend/src/components/Menu/Menu.tsx | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/components/Menu/Menu.test.tsx b/superset-frontend/src/components/Menu/Menu.test.tsx index 212521b..92c5e7d 100644 --- a/superset-frontend/src/components/Menu/Menu.test.tsx +++ b/superset-frontend/src/components/Menu/Menu.test.tsx @@ -24,6 +24,15 @@ import { dropdownItems } from './MenuRight'; const mockedProps = { data: { + user: { + roles: { + Admin: [ + ['can_sqllab', 'Superset'], + ['can_write', 'Chart'], + ['can_write', 'Dashboard'], + ], + }, + }, menu: [ { name: 'Home', diff --git a/superset-frontend/src/components/Menu/Menu.tsx b/superset-frontend/src/components/Menu/Menu.tsx index 10baa91..769f8c9 100644 --- a/superset-frontend/src/components/Menu/Menu.tsx +++ b/superset-frontend/src/components/Menu/Menu.tsx @@ -61,7 +61,9 @@ export interface MenuProps { brand: BrandProps; navbar_right: NavBarProps; settings: MenuObjectProps[]; - user: object; + user: { + roles: { [key: string]: string[][] }; + }; }; isFrontendRoute?: (path?: string) => boolean; }
