liquid_feedback_frontend
diff app/main/oauth2/token.lua @ 1583:202876945a6c
merge
author | jbe |
---|---|
date | Tue Jan 26 18:19:13 2021 +0100 (2021-01-26) |
parents | b4a377306a34 |
children | 2874a199c727 |
line diff
1.1 --- a/app/main/oauth2/token.lua Mon Dec 14 18:06:06 2020 +0100 1.2 +++ b/app/main/oauth2/token.lua Tue Jan 26 18:19:13 2021 +0100 1.3 @@ -254,8 +254,8 @@ 1.4 r.real_member_id = token.real_member_id 1.5 end 1.6 1.7 -if param.get("include_member", atom.boolean) then 1.8 - if allowed_scopes.identification or allowed_scopes.authentication then 1.9 +if allowed_scopes.identification or allowed_scopes.authentication then 1.10 + if param.get("include_member", atom.boolean) then 1.11 local member = token.member 1.12 r.member = json.object{ 1.13 id = member.id, 1.14 @@ -273,6 +273,14 @@ 1.15 r.real_member.identification = token.session.real_member.identification 1.16 end 1.17 end 1.18 + if unit.attr.role and param.get("include_roles") then 1.19 + r.roles = json.object() 1.20 + if not unit.attr.only_visible_for_role 1.21 + or member:has_role(unit.attr.only_visible_for_role) 1.22 + then 1.23 + r.roles[unit.attr.role] = true 1.24 + end 1.25 + end 1.26 end 1.27 end 1.28