group: introduce type auth_type, extend for PAM module

This commit is contained in:
Peter Bieringer
2026-07-19 14:35:18 +02:00
parent 912ea717a8
commit d9a0284996
7 changed files with 22 additions and 14 deletions

View File

@@ -598,14 +598,17 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
user = ""
if user:
if self.configuration.get("group", "type") != "none":
group_type = self.configuration.get("group", "type")
if group_type in ["htgroup"]:
self._rights._user_groups = self._group.groups(login) if login else set([])
elif self.configuration.get("auth", "type") == "ldap":
try:
logger.debug("Groups received from LDAP: %r", ",".join(self._auth._ldap_groups))
self._rights._user_groups = self._auth._ldap_groups
except AttributeError:
pass
elif group_type in ["auth_type"]:
auth_type = self.configuration.get("auth", "type")
if auth_type in ["ldap", "pam"]:
try:
logger.debug("Groups received from %r: %r", auth_type, ",".join(self._auth._groups))
self._rights._user_groups = self._auth._groups
except AttributeError:
pass
# Create principal collection
if user: