mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
[web] add a button for switching to the admin domain from www. GitOrigin-RevId: 7e14b9c1415ef6cad5f369d77530599bac3148e7
20 lines
455 B
JavaScript
20 lines
455 B
JavaScript
const Settings = require('@overleaf/settings')
|
|
|
|
module.exports = {
|
|
hasAdminAccess,
|
|
canRedirectToAdminDomain,
|
|
}
|
|
|
|
function hasAdminAccess(user) {
|
|
if (!Settings.adminPrivilegeAvailable) return false
|
|
if (!user) return false
|
|
return Boolean(user.isAdmin)
|
|
}
|
|
|
|
function canRedirectToAdminDomain(user) {
|
|
if (Settings.adminPrivilegeAvailable) return false
|
|
if (!Settings.adminUrl) return false
|
|
if (!user) return false
|
|
return Boolean(user.isAdmin)
|
|
}
|