Repository: learningequality/kolibri

Issue:
In Facility > User page, "Super Admins" filtered out by "Admin" filter
<!--
Instructions:
 * Fill out the sections below, replace …'s with information about your issue
 * Use the 'preview' function above this text box to verify formatting before submitting
-->

### Observed behavior

The special "Super Admin" or super user will be filtered out of the list by the "Admin" drop down filter option
### Expected behavior
<!--
Description of what behavior was expected but did not occur
-->
The Super Admin is not filtered out
…


…


### Context
0.12beta9

Use appropriate permissions for ClassSummary endpoint
### Observed behavior

In #5209, we fixed an issue where Promise rejections from unauthenticated requests to the notifications API was being swallowed by UI code (and not showing an AuthMessage component to users). We also added the most basic Permissions to the ClassSummary endpoint so that it would also return a 400 error for unauthenticated users.

However, the Permissions for Class Summary are too basic, and should be refined to be identical to permissions to AttemptLog, Groups, Exams, Lessons APIs, etc. (stuff ClassSummary aggregates).

There is a class `KolibriReportPermissions` that is used on some of the above-referenced APIs, that might be extended (or used as-is, possibly) on ClassSummary.


### Expected Behavior

ClassSummary permissions are exactly the same as endpoints that provide access to coach-only resources (exams, lessons, groups, logs, etc.)

### (Old) Observed behavior

1. When attempting to view a Coach page when an anonymous user, there is no "AuthMessage" component that explains why the page is not accessible. It's just a blank page. (No app bar either)
1. On Facility and Device pages, you do see that message, but on Device it's actually wrapped in KPageContainer (in Facility it's not)

![screen shot 2019-02-26 at 2 24 24 pm](https://user-images.githubusercontent.com/10248067/53450947-6f049f00-39d2-11e9-91e1-d99d1dcdd1e5.png)

### Expected behavior

1. When unauthenticated, accessing the coach pages shows an AuthMessage


### Context
0.12beta9


Discussion:

might relate to work done in https://github.com/learningequality/kolibri/issues/5014 ?


Resolving patch:
diff --git a/kolibri/plugins/coach/class_summary_api.py b/kolibri/plugins/coach/class_summary_api.py
--- a/kolibri/plugins/coach/class_summary_api.py
+++ b/kolibri/plugins/coach/class_summary_api.py
@@ -3,6 +3,7 @@
 from django.db.models import Sum
 from django.shortcuts import get_object_or_404
 from le_utils.constants import content_kinds
+from rest_framework import permissions
 from rest_framework import serializers
 from rest_framework import viewsets
 from rest_framework.response import Response
@@ -208,6 +209,10 @@ def data(Serializer, queryset):
 
 class ClassSummaryViewSet(viewsets.ViewSet):
 
+    # TODO use more granular permissions. Not sure if KolibriReportPermissions will
+    # work as is, though.
+    permission_classes = (permissions.IsAuthenticated,)
+
     def retrieve(self, request, pk):
         classroom = get_object_or_404(auth_models.Classroom, id=pk)
         query_learners = classroom.get_members()


Test patch: