Features.coffee 470 B

12345678910111213141516
  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. else
  14. throw new Error("unknown feature: #{feature}")