Blame view

src/access.ts 438 Bytes
calmound authored
1
2
3
export default (initialState: API.UserInfo) => {
  // 在这里按照初始化数据定义项目中的权限,统一管理
  // 参考文档 https://umijs.org/docs/max/access
zhongnanhuang authored
4
5
  const { roleSmallVO } = initialState;
calmound authored
6
  return {
zhongnanhuang authored
7
    canReadAdmin: roleSmallVO?.code === 'admin',
8
    canReadProcure: roleSmallVO?.code === 'procure',
zhongnanhuang authored
9
10
    canReadAdminAndFinance:
      roleSmallVO?.code === 'admin' || roleSmallVO?.code === 'finance',
calmound authored
11
12
  };
};