diff --git a/components/NavHeader.vue b/components/NavHeader.vue index 02067c39..d72b1c2b 100644 --- a/components/NavHeader.vue +++ b/components/NavHeader.vue @@ -49,12 +49,12 @@ - + - + diff --git a/middleware/isAdminOrEditor.js b/middleware/isAdminOrEditor.js new file mode 100644 index 00000000..63b359c9 --- /dev/null +++ b/middleware/isAdminOrEditor.js @@ -0,0 +1,5 @@ +export default async function ({ redirect, $auth }) { + if (!$auth.user.is_editor && !$auth.user.is_admin) { + return redirect('/') + } +} \ No newline at end of file diff --git a/pages/Admin.vue b/pages/Admin.vue index 06d15bba..795e4a61 100644 --- a/pages/Admin.vue +++ b/pages/Admin.vue @@ -1,14 +1,16 @@