From 9c38e30f382b3d9fd7e23b39865f2fa9f25b2c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Tue, 12 May 2020 09:17:14 +0200 Subject: [PATCH] user can only clone a board on canManage permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- .../navigation/AppNavigationBoard.vue | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index c3e810ef0..d8e5c2667 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -149,26 +149,27 @@ export default { text: t('deck', 'Edit board'), }) } - - actions.push({ - action: async() => { - this.hideMenu() - this.loading = true - try { - const newBoard = await this.$store.dispatch('cloneBoard', this.board) - this.loading = false - const route = this.routeTo - route.params.id = newBoard.id - this.$router.push(route) - } catch (e) { - OC.Notification.showTemporary(t('deck', 'An error occurred')) - console.error(e) - } - }, - icon: 'icon-clone', - text: t('deck', 'Clone board'), - }) if (canManage) { + + actions.push({ + action: async() => { + this.hideMenu() + this.loading = true + try { + const newBoard = await this.$store.dispatch('cloneBoard', this.board) + this.loading = false + const route = this.routeTo + route.params.id = newBoard.id + this.$router.push(route) + } catch (e) { + OC.Notification.showTemporary(t('deck', 'An error occurred')) + console.error(e) + } + }, + icon: 'icon-clone', + text: t('deck', 'Clone board'), + }) + if (!this.board.archived) { actions.push({ action: () => {