From 59a1d6ab41b54a8c50b968034791e7b704f29817 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Fri, 5 Apr 2019 14:32:51 -0400 Subject: [PATCH] ENT-1556 | Updating settings files to grab SYSTEM_WIDE_ROLE_CLASSES from config as expected Moving rbac settings above plugins Moving the setting above plugins in common.py for the lms and cms as well --- cms/envs/common.py | 5 ++--- cms/envs/production.py | 3 +++ lms/envs/common.py | 6 +++--- lms/envs/production.py | 3 +++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index 2f482ffc0f..485c6d40b7 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1558,6 +1558,8 @@ ZENDESK_CUSTOM_FIELDS = {} # (0.0 = 0%, 1.0 = 100%) COMPLETION_VIDEO_COMPLETE_PERCENTAGE = 0.95 +############### Settings for edx-rbac ############### +SYSTEM_WIDE_ROLE_CLASSES = [] ############## Installed Django Apps ######################### @@ -1569,6 +1571,3 @@ plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_c # setting for the FileWrapper class used to iterate over the export file data. # See: https://docs.python.org/2/library/wsgiref.html#wsgiref.util.FileWrapper COURSE_EXPORT_DOWNLOAD_CHUNK_SIZE = 8192 - -############### Settings for edx-rbac ############### -SYSTEM_WIDE_ROLE_CLASSES = os.environ.get("SYSTEM_WIDE_ROLE_CLASSES", []) diff --git a/cms/envs/production.py b/cms/envs/production.py index 3d1a21793c..01425d6b6a 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -600,6 +600,9 @@ RETIREMENT_STATES = ENV_TOKENS.get('RETIREMENT_STATES', RETIREMENT_STATES) ############## Settings for Course Enrollment Modes ###################### COURSE_ENROLLMENT_MODES = ENV_TOKENS.get('COURSE_ENROLLMENT_MODES', COURSE_ENROLLMENT_MODES) +############### Settings for edx-rbac ############### +SYSTEM_WIDE_ROLE_CLASSES = ENV_TOKENS.get('SYSTEM_WIDE_ROLE_CLASSES') or SYSTEM_WIDE_ROLE_CLASSES + ####################### Plugin Settings ########################## # This is at the bottom because it is going to load more settings after base settings are loaded diff --git a/lms/envs/common.py b/lms/envs/common.py index 563122120e..116a958d18 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3461,11 +3461,11 @@ FERNET_KEYS = [ # Maximum number of rows to fetch in XBlockUserStateClient calls. Adjust for performance USER_STATE_BATCH_SIZE = 5000 +############### Settings for edx-rbac ############### +SYSTEM_WIDE_ROLE_CLASSES = [] + ############## Plugin Django Apps ######################### from openedx.core.djangoapps.plugins import plugin_apps, plugin_settings, constants as plugin_constants INSTALLED_APPS.extend(plugin_apps.get_apps(plugin_constants.ProjectType.LMS)) plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.LMS, plugin_constants.SettingsType.COMMON) - -############### Settings for edx-rbac ############### -SYSTEM_WIDE_ROLE_CLASSES = os.environ.get("SYSTEM_WIDE_ROLE_CLASSES", []) diff --git a/lms/envs/production.py b/lms/envs/production.py index 2679a6ec15..71d52d2bed 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -1100,6 +1100,9 @@ COURSE_ENROLLMENT_MODES = ENV_TOKENS.get('COURSE_ENROLLMENT_MODES', COURSE_ENROL WRITABLE_GRADEBOOK_URL = ENV_TOKENS.get('WRITABLE_GRADEBOOK_URL', WRITABLE_GRADEBOOK_URL) PROFILE_MICROFRONTEND_URL = ENV_TOKENS.get('PROFILE_MICROFRONTEND_URL', PROFILE_MICROFRONTEND_URL) +############### Settings for edx-rbac ############### +SYSTEM_WIDE_ROLE_CLASSES = ENV_TOKENS.get('SYSTEM_WIDE_ROLE_CLASSES') or SYSTEM_WIDE_ROLE_CLASSES + ############################### Plugin Settings ############################### # This is at the bottom because it is going to load more settings after base settings are loaded