import { storage } from '@inside-library/helpers/Storage'

export default ({ next }) => {
  if (
    storage.get('current-user') &&
    storage.get('current-user').permissions.roles.some(
      role => ['Siège', 'Business Unit', 'super_administrator'].includes(role) // maybe use the setting here ? possible ?
    )
  ) {
    return next()
  }

  return next('/')
}
