User the intersection built in function of set to make the code more readable.
This commit is contained in:
@@ -70,10 +70,10 @@ class Rights(rights.BaseRights):
|
|||||||
group_match = []
|
group_match = []
|
||||||
try:
|
try:
|
||||||
collection_pattern = self._rights_config.get(section, "collection")
|
collection_pattern = self._rights_config.get(section, "collection")
|
||||||
user_pattern = self._rights_config.get(section, "user", fallback = "")
|
user_pattern = self._rights_config.get(section, "user", fallback = "")
|
||||||
groups = self._rights_config.get(section, "groups", fallback = "").split(",")
|
allowed_groups = self._rights_config.get(section, "groups", fallback = "").split(",")
|
||||||
try:
|
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))
|
logger.debug("Groups %r, %r",",".join(group_match),";".join(groups))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user