Merge pull request #3836 from overleaf/jpa-no-close-editor-in-saas

[views] admin: the open/close editor feature is not available in SAAS

GitOrigin-RevId: 6d9ba22e7843be7c27084a6bb5bc1c502ecdccc9
This commit is contained in:
Jakob Ackermann 2021-03-30 13:10:27 +02:00 committed by Copybot
parent 57cd6b4754
commit 60cefae09a
3 changed files with 37 additions and 30 deletions

View file

@ -52,6 +52,8 @@ const Features = {
*/ */
hasFeature(feature) { hasFeature(feature) {
switch (feature) { switch (feature) {
case 'saas':
return Boolean(Settings.overleaf)
case 'homepage': case 'homepage':
return Boolean(Settings.enableHomepage) return Boolean(Settings.enableHomepage)
case 'registration': case 'registration':

View file

@ -943,6 +943,7 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
AuthorizationMiddleware.ensureUserIsSiteAdmin, AuthorizationMiddleware.ensureUserIsSiteAdmin,
UserController.register UserController.register
) )
if (!Features.hasFeature('saas')) {
webRouter.post( webRouter.post(
'/admin/openEditor', '/admin/openEditor',
AuthorizationMiddleware.ensureUserIsSiteAdmin, AuthorizationMiddleware.ensureUserIsSiteAdmin,
@ -958,6 +959,7 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
AuthorizationMiddleware.ensureUserIsSiteAdmin, AuthorizationMiddleware.ensureUserIsSiteAdmin,
AdminController.disconnectAllUsers AdminController.disconnectAllUsers
) )
}
webRouter.post( webRouter.post(
'/admin/flushProjectToTpds', '/admin/flushProjectToTpds',
AuthorizationMiddleware.ensureUserIsSiteAdmin, AuthorizationMiddleware.ensureUserIsSiteAdmin,

View file

@ -35,6 +35,9 @@ block content
li(ng-non-bindable) #{agent} li(ng-non-bindable) #{agent}
tab(heading="Open/Close Editor") tab(heading="Open/Close Editor")
if hasFeature('saas')
| The "Open/Close Editor" feature is not available in SAAS.
else
.row-spaced .row-spaced
form(method='post',action='/admin/closeEditor') form(method='post',action='/admin/closeEditor')
input(name="_csrf", type="hidden", value=csrfToken) input(name="_csrf", type="hidden", value=csrfToken)