We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd748cd commit 6351ce8Copy full SHA for 6351ce8
3 files changed
ietf/ietfauth/tests.py
@@ -827,7 +827,7 @@ def test_oidc_code_auth(self):
827
session["nonce"] = rndstr()
828
args = {
829
"response_type": "code",
830
- "scope": ['openid', 'profile', 'email', 'roles', 'registration', ],
+ "scope": ['openid', 'profile', 'email', 'roles', 'registration', 'dots' ],
831
"nonce": session["nonce"],
832
"redirect_uri": redirect_uris[0],
833
"state": session["state"]
@@ -876,7 +876,7 @@ def test_oidc_code_auth(self):
876
# Get userinfo, check keys present
877
userinfo = client.do_user_info_request(state=params["state"], scope=args['scope'])
878
for key in [ 'email', 'family_name', 'given_name', 'meeting', 'name', 'roles',
879
- 'ticket_type', 'reg_type', 'affiliation', 'picture', ]:
+ 'ticket_type', 'reg_type', 'affiliation', 'picture', 'dots', ]:
880
self.assertIn(key, userinfo)
881
self.assertTrue(userinfo[key])
882
self.assertIn('remote', set(userinfo['reg_type'].split()))
ietf/ietfauth/utils.py
@@ -25,6 +25,7 @@
25
26
from ietf.group.models import Role, GroupFeatures
27
from ietf.person.models import Person
28
+from ietf.person.utils import get_dots
29
from ietf.doc.utils_bofreq import bofreq_editors
30
31
def user_is_person(user, person):
@@ -253,6 +254,10 @@ def scope_roles(self):
253
254
}
255
return info
256
257
+ def scope_dots(self):
258
+ dots = get_dots(self.user.person)
259
+ return { 'dots': dots }
260
+
261
info_registration = (
262
"IETF Meeting Registration Info",
263
"Access to public IETF meeting registration information for the current meeting. "
ietf/person/utils.py
@@ -15,6 +15,7 @@
15
import debug # pyflakes:ignore
16
17
18
+from ietf.group.models import GroupFeatures
19
from ietf.utils.mail import send_mail
20
21
def merge_persons(request, source, target, file=sys.stdout, verbose=False):
@@ -220,3 +221,22 @@ def get_active_irsg():
220
221
cache.set(cache_key, active_irsg_balloters)
222
return active_irsg_balloters
223
224
+def get_dots(person):
225
+ roles = person.role_set.filter(group__state_id__in=('active','bof','proposed'))
226
+ chair_group_types = ['wg', 'program', 'rg', 'iabasg']
227
+ dots = []
228
+ if roles.filter(name_id='chair',group__type_id__in=chair_group_types).exists():
229
+ dots.append('chair')
230
+ if roles.filter(group__acronym='iesg',name_id='ad').exists():
231
+ dots.append('ad')
232
+ if roles.filter(group__acronym='iab',name_id='member').exists():
233
+ dots.append('iab')
234
+ if roles.filter(group__acronym='irsg').exists():
235
+ dots.append('irsg')
236
+ if roles.filter(group__acronym='llc-board').exists():
237
+ dots.append('llc')
238
+ if roles.filter(group__acronym='ietf-trust').exists():
239
+ dots.append('trust')
240
+ if roles.filter(group__acronym__startswith='nomcom', name_id__in=('chair','member')).exists():
241
+ dots.append('nomcom')
242
+ return dots
0 commit comments