diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/__init__.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/__init__.py index b75ea0ee..e0c18ee5 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/__init__.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/__init__.py @@ -124,8 +124,8 @@ def setup_config(app: Flask) -> None: setup_database_uri(app) setup_logger(app) - if app.config["SPIFFWORKFLOW_DEFAULT_USER_GROUP"] == "": - app.config["SPIFFWORKFLOW_DEFAULT_USER_GROUP"] = None + if app.config["SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP"] == "": + app.config["SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP"] = None thread_local_data = threading.local() app.config["THREAD_LOCAL_DATA"] = thread_local_data diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py index f44d5b33..8002a998 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py @@ -2,15 +2,10 @@ import re from os import environ -# Does the site allow self-registration of users -SELF_REGISTRATION = environ.get("SELF_REGISTRATION", default=False) - -DEVELOPMENT = False - BPMN_SPEC_ABSOLUTE_DIR = environ.get("BPMN_SPEC_ABSOLUTE_DIR") -CORS_DEFAULT = "*" +cors_allow_all = "*" CORS_ALLOW_ORIGINS = re.split( - r",\s*", environ.get("CORS_ALLOW_ORIGINS", default=CORS_DEFAULT) + r",\s*", environ.get("CORS_ALLOW_ORIGINS", default=cors_allow_all) ) RUN_BACKGROUND_SCHEDULER = ( @@ -94,6 +89,6 @@ ALLOW_CONFISCATING_LOCK_AFTER_SECONDS = int( environ.get("ALLOW_CONFISCATING_LOCK_AFTER_SECONDS", default="600") ) -SPIFFWORKFLOW_DEFAULT_USER_GROUP = environ.get( - "SPIFFWORKFLOW_DEFAULT_USER_GROUP", default="everybody" +SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP = environ.get( + "SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP", default="everybody" ) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/users_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/users_controller.py index c9d2e129..c2a94390 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/users_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/users_controller.py @@ -26,6 +26,6 @@ def user_group_list_for_current_user() -> flask.wrappers.Response: group_identifiers = [ i.identifier for i in groups - if i.identifier != current_app.config["SPIFFWORKFLOW_DEFAULT_USER_GROUP"] + if i.identifier != current_app.config["SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP"] ] return make_response(jsonify(sorted(group_identifiers)), 200) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py index 0843a6e1..d00fc162 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py @@ -796,8 +796,8 @@ class AuthorizationService: for iutga in initial_user_to_group_assignments: # do not remove users from the default user group if ( - current_app.config["SPIFFWORKFLOW_DEFAULT_USER_GROUP"] is None - or current_app.config["SPIFFWORKFLOW_DEFAULT_USER_GROUP"] + current_app.config["SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP"] is None + or current_app.config["SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP"] != iutga.group.identifier ): current_user_dict: UserToGroupDict = { @@ -809,7 +809,7 @@ class AuthorizationService: # do not remove the default user group desired_group_identifiers.add( - current_app.config["SPIFFWORKFLOW_DEFAULT_USER_GROUP"] + current_app.config["SPIFFWORKFLOW_BACKEND_DEFAULT_USER_GROUP"] ) groups_to_delete = GroupModel.query.filter( GroupModel.identifier.not_in(desired_group_identifiers)