17 lines
376 B
TypeScript
17 lines
376 B
TypeScript
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
|
|
};
|
|
}
|