From fd371b87e451b66fe0326eb26776669579a7aa63 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 18 Jun 2020 15:33:34 +0200 Subject: [PATCH] Fix SAML default group ids setting --- .gitignore | 6 +++++- openslides/saml/README.md | 2 +- openslides/saml/settings.py | 2 +- openslides/saml/views.py | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a3d015171..2d3f5be56 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,10 @@ node_modules/* bower_components/* # OS4-Submodules -openslides-* +/openslides-* + +# OS3+ +/server/ # Local user data (settings, database, media, search index, static files) personal_data/* @@ -81,6 +84,7 @@ client/yarn.lock package-lock.json client/package-lock.json cypress.json +*-version.txt # System Files client/.DS_Store diff --git a/openslides/saml/README.md b/openslides/saml/README.md index b6fcbb6c3..f8b9e3aa8 100644 --- a/openslides/saml/README.md +++ b/openslides/saml/README.md @@ -82,6 +82,6 @@ One can overwrite the data extracted from the request headers of saml-requests. ### Default group ids -If the optional key `default_group_ids` is given, these groups are assigned to +If the optional key `defaultGroupIds` is given, these groups are assigned to each new created user on each saml login. It must be a list of ids. To disable this feature, either just do not inlcude this key, or set it to `null`. diff --git a/openslides/saml/settings.py b/openslides/saml/settings.py index 00064ecd8..4090139cc 100644 --- a/openslides/saml/settings.py +++ b/openslides/saml/settings.py @@ -214,7 +214,7 @@ class SamlSettings: raise SamlException('The https value must be "on" or "off"') def load_default_group_ids(self, content): - self.default_group_ids = content.pop("default_group_ids", None) + self.default_group_ids = content.pop("defaultGroupIds", None) if self.default_group_ids is None: return if not isinstance(self.default_group_ids, list): diff --git a/openslides/saml/views.py b/openslides/saml/views.py index 5f591ed30..cd6e14e8c 100644 --- a/openslides/saml/views.py +++ b/openslides/saml/views.py @@ -145,7 +145,7 @@ class SamlView(View): ) group_ids = get_saml_settings().default_group_ids if group_ids: - user.groups.add(group_ids) + user.groups.add(*group_ids) inform_changed_data(user) # put the new user into the cache else: logger.info(