Skip to content

Commit

Permalink
Ensure learner cannot download resource from content page when downlo…
Browse files Browse the repository at this point in the history
…ading is disabled
  • Loading branch information
marcellamaki committed Oct 6, 2023
1 parent 22b0bc9 commit 48031b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -322,6 +322,7 @@
fetchContentNodeProgress,
fetchContentNodeTreeProgress,
fetchLesson,
canAddDownloads,
back,
genExternalBackURL,
addDownloadRequest,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 48031b0

Please sign in to comment.