Fix SAML default group ids setting

This commit is contained in:
FinnStutzenstein 2020-06-18 15:33:34 +02:00
parent b43151fd59
commit fd371b87e4
No known key found for this signature in database
GPG Key ID: 9042F605C6324654
4 changed files with 8 additions and 4 deletions

6
.gitignore vendored
View File

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

View File

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

View File

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

View File

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