From dda9f7501151eb30d1fcac8abd41fd2e901cbb90 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 9 May 2019 10:20:26 +0200 Subject: [PATCH] Disable task content block creation for students --- .../content-block-form/ContentsForm.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/client/src/components/content-block-form/ContentsForm.vue b/client/src/components/content-block-form/ContentsForm.vue index 462b9f82..c646c33e 100644 --- a/client/src/components/content-block-form/ContentsForm.vue +++ b/client/src/components/content-block-form/ContentsForm.vue @@ -7,7 +7,7 @@ :error="error" data-cy="modal-title-input" > -
- Speichern + Speichern Abbrechen
@@ -75,6 +76,8 @@ import TrashIcon from '@/components/icons/TrashIcon'; import Checkbox from '@/components/Checkbox'; + import {meQuery} from '@/graphql/queries'; + export default { props: { 'content-block': Object, @@ -115,13 +118,21 @@ contents: [...this.contentBlock.contents], id: this.contentBlock.id || undefined, isAssignment: this.contentBlock.type && this.contentBlock.type === 'TASK' - }) + }), + me: {} } }, + apollo: { + me: meQuery + }, + computed: { titlePlaceholder() { return this.blockType === 'RoomEntry' ? 'Titel für Raumeintrag erfassen' : 'Titel für Inhaltsblock erfassen'; + }, + taskSelection() { + return this.showTaskSelection && this.me.permissions.includes('users.can_manage_school_class_content'); } },