We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dea510c commit 423183dCopy full SHA for 423183d
social_core/backends/cas.py
@@ -62,15 +62,7 @@ def get_user_details(self, response):
62
}
63
64
def auth_allowed(self, response, details):
65
- if not super().auth_allowed(response, details):
66
- return False
67
-
68
- allow_groups = self.setting("ALLOW_GROUPS", [])
69
- if not allow_groups:
70
- return True
71
72
- groups = response.get("groups", [])
73
- for group in groups:
74
- if group in allow_groups:
75
76
+ allow_groups = set(self.setting("ALLOW_GROUPS", set()))
+ groups = set(response.get("groups", set()))
+ return super().auth_allowed(response, details) if groups.intersection(allow_groups) or \
+ not allow_groups else False
0 commit comments