diff --git a/storyboard/api/v1/system_info.py b/storyboard/api/v1/system_info.py index 103b313c..4374153a 100644 --- a/storyboard/api/v1/system_info.py +++ b/storyboard/api/v1/system_info.py @@ -1,4 +1,5 @@ # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# Copyright (c) 2019 Codethink Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,5 +42,12 @@ class SystemInfoController(rest.RestController): """ sb_ver = VersionInfo('storyboard-api') + config = { + 'enable_editable_comments': CONF.enable_editable_comments, + 'enable_notifications': CONF.enable_notifications + } - return wmodels.SystemInfo(version=sb_ver.version_string()) + return wmodels.SystemInfo( + config=config, + version=sb_ver.version_string() + ) diff --git a/storyboard/api/v1/wmodels.py b/storyboard/api/v1/wmodels.py index d6a91156..eb623fb4 100644 --- a/storyboard/api/v1/wmodels.py +++ b/storyboard/api/v1/wmodels.py @@ -64,12 +64,16 @@ class SystemInfo(base.APIBase): """Represents the system information for Storyboard """ + config = {wtypes.text: bool} + """Information about enabled features from configuration.""" + version = wtypes.text """The application version.""" @classmethod def sample(cls): return cls( + config={"enable_editable_comments": True}, version="338c2d6") diff --git a/storyboard/tests/api/test_system_info.py b/storyboard/tests/api/test_system_info.py index 891d3a65..5151730b 100644 --- a/storyboard/tests/api/test_system_info.py +++ b/storyboard/tests/api/test_system_info.py @@ -28,4 +28,4 @@ class TestSystemInfo(base.FunctionalTest): preferences work properly. """ response = self.get_json(self.resource) - self.assertEqual(1, len(response)) + self.assertEqual(2, len(response))