From 48031b0305d6448abc4c92bd52b1158f6e2bfb1d Mon Sep 17 00:00:00 2001 From: Marcella Maki Date: Fri, 6 Oct 2023 17:33:12 -0400 Subject: [PATCH] Ensure learner cannot download resource from content page when downloading is disabled --- .../plugins/learn/assets/src/views/TopicsContentPage.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue b/kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue index 8626c856860..353cd221c3c 100644 --- a/kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue +++ b/kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue @@ -229,7 +229,7 @@ const currentInstance = getCurrentInstance().proxy; const store = currentInstance.$store; const router = currentInstance.$router; - const { canDownloadExternally } = useCoreLearn(); + const { canDownloadExternally, canAddDownloads } = useCoreLearn(); const { fetchContentNodeProgress, fetchContentNodeTreeProgress, @@ -322,6 +322,7 @@ fetchContentNodeProgress, fetchContentNodeTreeProgress, fetchLesson, + canAddDownloads, back, genExternalBackURL, addDownloadRequest, @@ -453,7 +454,10 @@ return this.content.admin_imported || this.isDownloadedByLearner(this.content); }, allowRemoteDownload() { - return this.isUserLoggedIn && this.isRemoteContent && !this.isDownloaded; + console.log(this.canAddDownloads); + return ( + this.isUserLoggedIn && this.isRemoteContent && !this.isDownloaded && this.canAddDownloads + ); }, allowBookmark() { return this.isUserLoggedIn && (!this.isRemoteContent || this.isDownloaded);