import store from '@/store'

export function checkPermission (value) {
  const datas = []
  const roles = store.getters && store.getters.roles
  if (value && value instanceof Array) {
    if (value.length) {
      const permissionRoles = value
      roles.some(role => {
        datas.push(permissionRoles.includes(role))
      })
    } else {
      return ''
    }
  } else {
    return ''
  }
  if (datas.includes(true)) {
    return false
  } else {
    return true
  }
}