mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add missed Features.coffee
This commit is contained in:
parent
745ae8d081
commit
a97c3ba580
1 changed files with 12 additions and 0 deletions
12
services/web/app/coffee/infrastructure/Features.coffee
Normal file
12
services/web/app/coffee/infrastructure/Features.coffee
Normal 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}")
|
Loading…
Reference in a new issue