Merge pull request #6614 from overleaf/jpa-msm-separate-admin-app

[misc] move admin capability from www. to admin. subdomain

GitOrigin-RevId: e0daeacf3c06b856ffb9fd35dce76e71f14e8459
This commit is contained in:
Jakob Ackermann
2022-03-31 11:34:49 +01:00
committed by Copybot
parent c96fbc526e
commit e82a053c85
25 changed files with 223 additions and 20 deletions
@@ -2,6 +2,7 @@ const { ObjectId } = require('mongodb')
const _ = require('lodash')
const { promisify } = require('util')
const Settings = require('@overleaf/settings')
const { hasAdminAccess } = require('../Helpers/AdminAuthorizationHelper')
const ENGINE_TO_COMPILER_MAP = {
latex_dvipdf: 'latex',
@@ -165,7 +166,7 @@ function _addNumericSuffixToProjectName(name, allProjectNames, maxLength) {
function getAllowedImagesForUser(sessionUser) {
const images = Settings.allowedImageNames || []
if (sessionUser && sessionUser.isAdmin) {
if (hasAdminAccess(sessionUser)) {
return images
} else {
return images.filter(image => !image.adminOnly)