Fix SAML default group ids setting
This commit is contained in:
parent
b43151fd59
commit
fd371b87e4
6
.gitignore
vendored
6
.gitignore
vendored
@ -14,7 +14,10 @@ node_modules/*
|
|||||||
bower_components/*
|
bower_components/*
|
||||||
|
|
||||||
# OS4-Submodules
|
# OS4-Submodules
|
||||||
openslides-*
|
/openslides-*
|
||||||
|
|
||||||
|
# OS3+
|
||||||
|
/server/
|
||||||
|
|
||||||
# Local user data (settings, database, media, search index, static files)
|
# Local user data (settings, database, media, search index, static files)
|
||||||
personal_data/*
|
personal_data/*
|
||||||
@ -81,6 +84,7 @@ client/yarn.lock
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
client/package-lock.json
|
client/package-lock.json
|
||||||
cypress.json
|
cypress.json
|
||||||
|
*-version.txt
|
||||||
|
|
||||||
# System Files
|
# System Files
|
||||||
client/.DS_Store
|
client/.DS_Store
|
||||||
|
@ -82,6 +82,6 @@ One can overwrite the data extracted from the request headers of saml-requests.
|
|||||||
|
|
||||||
### Default group ids
|
### 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
|
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`.
|
this feature, either just do not inlcude this key, or set it to `null`.
|
||||||
|
@ -214,7 +214,7 @@ class SamlSettings:
|
|||||||
raise SamlException('The https value must be "on" or "off"')
|
raise SamlException('The https value must be "on" or "off"')
|
||||||
|
|
||||||
def load_default_group_ids(self, content):
|
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:
|
if self.default_group_ids is None:
|
||||||
return
|
return
|
||||||
if not isinstance(self.default_group_ids, list):
|
if not isinstance(self.default_group_ids, list):
|
||||||
|
@ -145,7 +145,7 @@ class SamlView(View):
|
|||||||
)
|
)
|
||||||
group_ids = get_saml_settings().default_group_ids
|
group_ids = get_saml_settings().default_group_ids
|
||||||
if 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
|
inform_changed_data(user) # put the new user into the cache
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.info(
|
||||||
|
Loading…
Reference in New Issue
Block a user