salary-management-oneself/src/access.ts

17 lines
376 B
TypeScript
Raw Normal View History

2022-08-04 15:20:59 +08:00
import _ from 'lodash';
export default function (initialState: any) {
const { user } = initialState;
const roles = _.isEmpty(user) ? [] : user.roles;
return {
// roles.indexOf('ROLE_USER') >= 0
canUsePortal: true,
// _.some(
// roles,
// (role: string) => _.isString(role) && role.indexOf('ADMIN') >= 0,
// ),
canUseManage: true
};
}