mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 14:14:49 -05:00
22 lines
664 B
CoffeeScript
22 lines
664 B
CoffeeScript
Settings = require 'settings-sharelatex'
|
|
|
|
module.exports = Features =
|
|
externalAuthenticationSystemUsed: ->
|
|
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
|
|
|
|
hasFeature: (feature) ->
|
|
switch feature
|
|
when 'homepage'
|
|
return Settings.enableHomepage
|
|
when 'registration'
|
|
return not Features.externalAuthenticationSystemUsed()
|
|
when 'github-sync'
|
|
return Settings.enableGithubSync
|
|
when 'v1-return-message'
|
|
return Settings.accountMerge? and Settings.overleaf?
|
|
when 'rich-text'
|
|
return Settings.showRichText
|
|
when 'custom-togglers'
|
|
return Settings.overleaf?
|
|
else
|
|
throw new Error("unknown feature: #{feature}")
|