Hide people for non-admin if no recognize (fix #103)

old-stable24
Varun Patil 2022-10-24 09:38:39 -07:00
parent 80176629e3
commit ebbc8ac12c
1 changed files with 7 additions and 2 deletions

View File

@ -20,7 +20,7 @@
<Video slot="icon" :size="20" /> <Video slot="icon" :size="20" />
</NcAppNavigationItem> </NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'people'}" <NcAppNavigationItem :to="{name: 'people'}"
:title="t('memories', 'People')"> :title="t('memories', 'People')" v-if="showPeople">
<PeopleIcon slot="icon" :size="20" /> <PeopleIcon slot="icon" :size="20" />
</NcAppNavigationItem> </NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'archive'}" <NcAppNavigationItem :to="{name: 'archive'}"
@ -57,7 +57,8 @@ import {
NcContent, NcAppContent, NcAppNavigation, NcContent, NcAppContent, NcAppNavigation,
NcAppNavigationItem, NcAppNavigationSettings, NcAppNavigationItem, NcAppNavigationSettings,
} from '@nextcloud/vue'; } from '@nextcloud/vue';
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router';
import { getCurrentUser } from '@nextcloud/auth';
import Timeline from './components/Timeline.vue' import Timeline from './components/Timeline.vue'
import Settings from './components/Settings.vue' import Settings from './components/Settings.vue'
@ -97,6 +98,10 @@ import TagsIcon from 'vue-material-design-icons/Tag.vue';
export default class App extends Mixins(GlobalMixin, UserConfig) { export default class App extends Mixins(GlobalMixin, UserConfig) {
// Outer element // Outer element
get showPeople() {
return this.config_recognizeEnabled || getCurrentUser()?.isAdmin;
}
public mounted() { public mounted() {
// Get the content-vue element and add nextcloud version as a class to it // Get the content-vue element and add nextcloud version as a class to it
const contentVue = document.querySelector('#content-vue'); const contentVue = document.querySelector('#content-vue');