Переглянути джерело

Fixing Inheritability of Permissions (#5347)

https://github.com/ant-design/ant-design-pro/issues/4883
拷钉 6 роки тому
батько
коміт
21e1794335
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      src/pages/Authorized.tsx

+ 3 - 0
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