You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
376 B
TypeScript
17 lines
376 B
TypeScript
3 years ago
|
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
|
||
|
};
|
||
|
}
|