diff options
| author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-15 15:46:53 +0200 |
|---|---|---|
| committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-15 15:46:58 +0200 |
| commit | 160520dbdec17250a74d5f87174cacb3f72eae26 (patch) | |
| tree | 8ded99e1dc73bc4c277061b335633511eaa49b35 /service/pixelated/controllers | |
| parent | b17bba7c89bf495ec882e5beebe97859dbedf094 (diff) | |
Extracting features controller
Diffstat (limited to 'service/pixelated/controllers')
| -rw-r--r-- | service/pixelated/controllers/__init__.py | 1 | ||||
| -rw-r--r-- | service/pixelated/controllers/features_controller.py | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/service/pixelated/controllers/__init__.py b/service/pixelated/controllers/__init__.py index 84d7bf4d..fd14b01b 100644 --- a/service/pixelated/controllers/__init__.py +++ b/service/pixelated/controllers/__init__.py @@ -27,3 +27,4 @@ from flask import Response from home_controller import HomeController from mails_controller import MailsController from tags_controller import TagsController +from features_controller import FeaturesController diff --git a/service/pixelated/controllers/features_controller.py b/service/pixelated/controllers/features_controller.py new file mode 100644 index 00000000..d3438352 --- /dev/null +++ b/service/pixelated/controllers/features_controller.py @@ -0,0 +1,32 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. + +from pixelated.controllers import respond_json +import os + + +class FeaturesController: + DISABLED_FEATURES = ['draftReply', 'signatureStatus', 'encryptionStatus', 'contacts'] + + def __init__(self): + pass + + def features(self): + try: + disabled_features = {'logout': os.environ['DISPATCHER_LOGOUT_URL']} + except KeyError: + disabled_features = {} + return respond_json({'disabled_features': self.DISABLED_FEATURES, 'dispatcher_features': disabled_features})
\ No newline at end of file |
