mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-30 21:20:48 +00:00
16 lines
470 B
CoffeeScript
16 lines
470 B
CoffeeScript
Settings = require 'settings-sharelatex'
|
|
|
|
module.exports = Features =
|
|
externalAuthenticationSystemUsed: ->
|
|
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
|
|
|
|
hasFeature: (feature) ->
|
|
switch feature
|
|
when 'homepage'
|
|
return Settings.enableHomepage
|
|
when 'registration'
|
|
return not Features.externalAuthenticationSystemUsed()
|
|
when 'github-sync'
|
|
return Settings.enableGithubSync
|
|
else
|
|
throw new Error("unknown feature: #{feature}")
|