updated default user group var name for better prefix w/ burnettk

This commit is contained in:
jasquat 2023-02-15 16:43:40 -05:00
parent a6a1f06941
commit f9a7e40488
No known key found for this signature in database
4 changed files with 10 additions and 15 deletions

View File

@ -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

View File

@ -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"
)

View File

@ -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)

View File

@ -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)