You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
458 B

  1. export default async function({ app, store, route, redirect }) {
  2. if (store.getters['projects/isEmpty']) {
  3. await store.dispatch('projects/setCurrentProject', route.params.id)
  4. }
  5. const role = store.getters['projects/getCurrentUserRole']
  6. const projectRoot = app.localePath('/projects/' + route.params.id)
  7. const path = route.fullPath.replace(/\/$/g, '')
  8. if (!role.is_project_admin && path !== projectRoot) {
  9. return redirect(projectRoot)
  10. }
  11. }