From 21e1794335dd7c523db5d40306a05710ead43eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8B=B7=E9=92=89?= <41830859@qq.com> Date: Tue, 1 Oct 2019 16:14:00 +0800 Subject: [PATCH] Fixing Inheritability of Permissions (#5347) https://github.com/ant-design/ant-design-pro/issues/4883 --- src/pages/Authorized.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/Authorized.tsx b/src/pages/Authorized.tsx index 54976111..9c94e479 100644 --- a/src/pages/Authorized.tsx +++ b/src/pages/Authorized.tsx @@ -12,6 +12,9 @@ interface AuthComponentProps extends ConnectProps { const getRouteAuthority = (path: string, routeData: Route[]) => { let authorities: string[] | string | undefined; routeData.forEach(route => { + if (route.authority) { + authorities = route.authority; + } // match prefix if (pathToRegexp(`${route.path}(.*)`).test(path)) { // exact match