Merge pull request #15006 from open-craft/bdero/bulk-enroll

Upstream the Bulk Enroll API endpoint
This commit is contained in:
George Song
2017-07-14 14:20:23 -07:00
committed by GitHub
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.