Compare commits

...
This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.

1 commit

Author SHA1 Message Date
phoenixeliot
da7d422391 Only allow admins to view verifier 2016-06-20 09:46:43 -07:00

View file

@ -99,8 +99,8 @@ module.exports = class CocoRouter extends Backbone.Router
'editor/poll': go('editor/poll/PollSearchView')
'editor/poll/:articleID': go('editor/poll/PollEditView')
'editor/thang-tasks': go('editor/ThangTasksView')
'editor/verifier': go('editor/verifier/VerifierView')
'editor/verifier/:levelID': go('editor/verifier/VerifierView')
'editor/verifier': go('editor/verifier/VerifierView', { adminOnly: true })
'editor/verifier/:levelID': go('editor/verifier/VerifierView', { adminOnly: true })
'file/*path': 'routeToServer'
@ -176,6 +176,8 @@ module.exports = class CocoRouter extends Backbone.Router
return @routeDirectly('teachers/RestrictedToTeachersView')
if options.studentsOnly and not (me.isStudent() or me.isAdmin())
return @routeDirectly('courses/RestrictedToStudentsView')
if options.adminOnly and not me.isAdmin()
return @routeDirectly('NotFoundView')
leavingMessage = _.result(window.currentView, 'onLeaveMessage')
if leavingMessage
if not confirm(leavingMessage)