import { UserVO } from "./services/login/types";

/**
 * @see https://umijs.org/docs/max/access#access
 * */
export default function access(
  initialState: { currentUser?: { user: UserVO } } | undefined
) {
  const { currentUser } = initialState ?? {};
  return {
    canAdmin: currentUser && currentUser.user.username === "admin",
  };
}
