2017-11-20 06:43:02 -05:00
|
|
|
Settings = require 'settings-sharelatex'
|
|
|
|
|
|
|
|
module.exports = Features =
|
|
|
|
externalAuthenticationSystemUsed: ->
|
|
|
|
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
|
|
|
|
|
|
|
|
hasFeature: (feature) ->
|
|
|
|
switch feature
|
2017-11-22 05:44:13 -05:00
|
|
|
when 'homepage'
|
|
|
|
return Settings.enableHomepage
|
2017-11-20 06:43:02 -05:00
|
|
|
when 'registration'
|
|
|
|
return not Features.externalAuthenticationSystemUsed()
|
2017-11-20 06:48:06 -05:00
|
|
|
when 'github-sync'
|
2017-11-22 05:44:57 -05:00
|
|
|
return Settings.enableGithubSync
|
2018-01-31 05:05:56 -05:00
|
|
|
when 'v1-return-message'
|
|
|
|
return Settings.accountMerge? and Settings.overleaf?
|
2018-02-05 10:35:00 -05:00
|
|
|
when 'rich-text'
|
|
|
|
return Settings.showRichText
|
2017-11-20 06:43:02 -05:00
|
|
|
else
|
|
|
|
throw new Error("unknown feature: #{feature}")
|