Upstream the Bulk Enroll API endpoint

This commit is contained in:
Brandon DeRosier
2017-03-31 14:36:55 -04:00
parent 13e06a37a3
commit a31855c935
10 changed files with 463 additions and 0 deletions

View File

@@ -119,6 +119,16 @@ class IsMasterCourseStaffInstructor(permissions.BasePermission):
return False
class IsStaff(permissions.BasePermission):
"""
Permission that checks to see if the request user has is_staff access.
"""
def has_permission(self, request, view):
if request.user.is_staff:
return True
class IsUserInUrlOrStaff(IsUserInUrl):
"""
Permission that checks to see if the request user matches the user in the URL or has is_staff access.