From a97c3ba5808c1aeb8fe40363fbf0e918764f77e4 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 20 Nov 2017 11:43:02 +0000 Subject: [PATCH] Add missed Features.coffee --- .../web/app/coffee/infrastructure/Features.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 services/web/app/coffee/infrastructure/Features.coffee diff --git a/services/web/app/coffee/infrastructure/Features.coffee b/services/web/app/coffee/infrastructure/Features.coffee new file mode 100644 index 0000000000..e4a8fefbe8 --- /dev/null +++ b/services/web/app/coffee/infrastructure/Features.coffee @@ -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}")