Redirect users when they cannot access content (#48)

TNL-7171, TNL-7172, TNL-7173, TNL-7174: When a user is denied access to load courseware, redirect them to the appropriate location based upon the error code returned. If the error code is unknown they will be redirected to course home.
This commit is contained in:
Adam Butterworth
2020-04-15 12:56:51 -04:00
committed by GitHub
parent a852182a00
commit 1cc7dc266b
4 changed files with 26 additions and 5 deletions

View File

@@ -15,8 +15,7 @@ function normalizeMetadata(metadata) {
start: metadata.start,
enrollmentMode: metadata.enrollment.mode,
isEnrolled: metadata.enrollment.is_active,
canLoadCourseware: typeof metadata.can_load_courseware === 'boolean'
? metadata.can_load_courseware : metadata.can_load_courseware.has_access,
canLoadCourseware: camelCaseObject(metadata.can_load_courseware),
isStaff: metadata.is_staff,
verifiedMode: camelCaseObject(metadata.verified_mode),
tabs: camelCaseObject(metadata.tabs),