overleaf/services/web/app/coffee/infrastructure/Features.coffee
2017-11-20 11:43:02 +00:00

12 lines
357 B
CoffeeScript

Settings = require 'settings-sharelatex'
module.exports = Features =
externalAuthenticationSystemUsed: ->
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
hasFeature: (feature) ->
switch feature
when 'registration'
return not Features.externalAuthenticationSystemUsed()
else
throw new Error("unknown feature: #{feature}")