import Store from '@/store'

export const hasRole = (projectId, roles) => {
  if (!projectId) {
    return true
  }
  const permissions = Store.getters && Store.getters.permissions
  const p = permissions[projectId]
  return p === 0 || roles.indexOf(p) !== -1
}