import * as React from "react";
import { Access, Redirect, useAccess } from "umi";

export default (props: any) => {
  const access = useAccess();
  return (
    <Access
      accessible={access.canUseManage}
      // @ts-ignore
      fallback={<Redirect to="/exception/403"/>}
    >
      {props.children}
    </Access>
  );
};
