Repository: learningequality/kolibri

Issue:
Make Download content option for videos configurable at the facility level.
## Summary

As you know leaners will always be playfully clicking on the Download content and our tablets will get filled up with downloaded content. 

Hence please remove make Download content option for videos configurable at the facility level.

## System information
 - Version: Kolibri 0.4.0beta9
 - Operating system: Ubuntu 14.04 LTS
 - Browser: Chrome

## How to reproduce
1. Log in as a learner
2. Access a video
3. Below the video download content has to be removed.

## Screenshots
![whatsapp image 2017-06-07 at 1 01 07 pm](https://user-images.githubusercontent.com/13453618/26867119-a679d432-4b81-11e7-9548-ee511981b7ca.jpeg)






Discussion:
One approach would be to let the Superuser configure whether or not the 'Download Content' button appears. To handle this situation, the admin would disable the 'Download Content'.
^ I think this may be the best approach. To address @rtibbles' concern about proliferating facility configuration options, there are ways to organize the options on the UI so that it appears less overwhelming and complex. It might be inevitable if we want to design for the many different contexts that Kolibri will appear in.
I think @jonboiser's approach is probably our best bet for now. As flags are ever-proliferating, I can definitely see content downloading as an important component a device owner would want to toggle on/off depending on the context. I would suggest embedding the download option in a "more..." options kind of widget/button in order to make downloading more difficult to get to, but we don't have many options other than download at the moment. 

Or password encoding it, which would be neat, but is kind of a stretch
An additional need for this just arose, whereby content partners with special distribution agreements may be recalcitrant to have their content in Kolibri if it can be downloaded like this.
@indirectlylit if this is just implemented as a facility setting, do you see any further design needed, beyond selecting the default values for this for the three different configuration contexts?
This thread began before we introduced superusers and got rid of device owners, so we need to update the plan.

In particular, is it a device or a facility setting? (configurable by superusers or facility admins?)
From the foregoing, I think it is more of a facility setting, as it depends more on the context of use (which is how we have defined the facility setting scenarios), rather than something inherent to any particular device.
Okay, sounds fine to me.

![image](https://user-images.githubusercontent.com/2367265/36496936-af11da70-16ee-11e8-8231-61db204b1bf8.png)

I suppose we will just add a new item to this list. The consistent phrasing would be:

> Allow learners to download content

That might be technically incorrect because a savvy learner could download it anyway. Alternative phrasing:

> Show 'download content' button to learners

Since this is an admin screen, might be good to go with 'technically correct' over 'consistent'?

for 0.9, going with:

> Show 'download' button with content

Resolving patch:
diff --git a/kolibri/auth/migrations/0011_facilitydataset_show_download_button_in_learn.py b/kolibri/auth/migrations/0011_facilitydataset_show_download_button_in_learn.py
new file mode 100644
--- /dev/null
+++ b/kolibri/auth/migrations/0011_facilitydataset_show_download_button_in_learn.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-03-23 23:56
+from __future__ import unicode_literals
+
+from django.db import migrations
+from django.db import models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('kolibriauth', '0010_auto_20180320_1320'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='facilitydataset',
+            name='show_download_button_in_learn',
+            field=models.BooleanField(default=True),
+        ),
+    ]
diff --git a/kolibri/auth/models.py b/kolibri/auth/models.py
--- a/kolibri/auth/models.py
+++ b/kolibri/auth/models.py
@@ -115,6 +115,7 @@ class FacilityDataset(FacilityDataSyncableModel):
     learner_can_sign_up = models.BooleanField(default=True)
     learner_can_delete_account = models.BooleanField(default=True)
     learner_can_login_with_no_password = models.BooleanField(default=False)
+    show_download_button_in_learn = models.BooleanField(default=True)
 
     def __str__(self):
         facilities = self.collection_set.filter(kind=collection_kinds.FACILITY)
diff --git a/kolibri/auth/serializers.py b/kolibri/auth/serializers.py
--- a/kolibri/auth/serializers.py
+++ b/kolibri/auth/serializers.py
@@ -71,10 +71,11 @@ class Meta:
         model = FacilityDataset
         fields = ('id', 'learner_can_edit_username', 'learner_can_edit_name', 'learner_can_edit_password',
                   'learner_can_sign_up', 'learner_can_delete_account', 'learner_can_login_with_no_password',
-                  'description', 'location')
+                  'show_download_button_in_learn', 'description', 'location')
 
 
 class FacilitySerializer(serializers.ModelSerializer):
+    dataset = FacilityDatasetSerializer(read_only=True)
 
     class Meta:
         model = Facility


Test patch: