Features.coffee 608 B

1234567891011121314151617181920
  1. Settings = require 'settings-sharelatex'
  2. module.exports = Features =
  3. externalAuthenticationSystemUsed: ->
  4. Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
  5. hasFeature: (feature) ->
  6. switch feature
  7. when 'homepage'
  8. return Settings.enableHomepage
  9. when 'registration'
  10. return not Features.externalAuthenticationSystemUsed()
  11. when 'github-sync'
  12. return Settings.enableGithubSync
  13. when 'v1-return-message'
  14. return Settings.accountMerge? and Settings.overleaf?
  15. when 'rich-text'
  16. return Settings.showRichText
  17. else
  18. throw new Error("unknown feature: #{feature}")