Add missed Features.coffee

This commit is contained in:
James Allen 2017-11-20 11:43:02 +00:00
parent 745ae8d081
commit a97c3ba580

View file

@ -0,0 +1,12 @@
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}")