Display message on admin routes if non-admin tries to view

This commit is contained in:
Troplo 2021-01-21 20:56:30 +11:00
parent 66f98fd194
commit 80a52bdcec
2 changed files with 30 additions and 17 deletions

View file

@ -170,7 +170,8 @@
"loading": "Loading",
"noItemsConnection": "Please check your internet connection, or try again later.",
"noItemsStart": "There are no",
"noItemsEnd": "to display."
"noItemsEnd": "to display.",
"adminOnly": "Only users with admin are allowed to navigate to this route."
},
"relationships": {
"pending": "Cancel Friend Request",

View file

@ -1,5 +1,6 @@
<template>
<div class="columns is-centered">
<main class="section">
<div class="columns is-centered" v-if="$store.state.user.admin">
<div class="column is-2">
<b-menu class="box">
<b-menu-list :label="$t('admin.title')">
@ -17,4 +18,15 @@
</div>
</div>
</div>
<div class="column" v-if="!$store.state.user.admin">
<div class="box">
<div class="is-vcentered has-text-centered columns">
<div class="column is-vcentered">
<i class="far fa-times-square large-icon"></i>
<h1 class="subtitle">{{$t('generic.adminOnly')}}</h1>
</div>
</div>
</div>
</div>
</main>
</template>