1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

User the intersection built in function of set to make the code more readable.

This commit is contained in:
Peter Varkoly 2022-02-24 10:45:45 +01:00
parent c5b5910de4
commit b0f8d37294

View file

@ -70,10 +70,10 @@ class Rights(rights.BaseRights):
group_match = []
try:
collection_pattern = self._rights_config.get(section, "collection")
user_pattern = self._rights_config.get(section, "user", fallback = "")
groups = self._rights_config.get(section, "groups", fallback = "").split(",")
user_pattern = self._rights_config.get(section, "user", fallback = "")
allowed_groups = self._rights_config.get(section, "groups", fallback = "").split(",")
try:
group_match = self._user_groups & set(groups)
group_match = self._user_groups.intersection(allowed_groups)
logger.debug("Groups %r, %r",",".join(group_match),";".join(groups))
except:
pass