liquid_feedback_frontend

view app/main/api/info.lua @ 1858:3d1f0464a3ea

Handle missing ldap.member.allowed function
author bsw
date Tue Sep 20 17:35:29 2022 +0200 (20 months ago)
parents 32cc544d5a5b
children
line source
1 slot.set_layout(nil, "application/json")
3 local scope_string
5 local scopes_list = {}
6 for scope in pairs(app.scopes) do
7 scopes_list[#scopes_list+1] = scope
8 end
9 local scopes_string = table.concat(scopes_list, " ")
11 local result = {}
13 local r = json.object{
14 service = "LiquidFeedback",
15 core_version = db:query("SELECT * from liquid_feedback_version;")[1].string,
16 api_version = config.app_version,
17 client_tls_dn = request.get_header("X-SSL-DN"),
18 scope = scopes_string
19 }
21 if app.scopes.identification or app.scopes.authentication then
22 r.member_id = app.access_token.member_id
23 if app.access_token.member.role then
24 r.member_is_role = true
25 end
26 if app.access_token.session then
27 r.real_member_id = app.access_token.session.real_member_id
28 end
29 if param.get("include_member", atom.boolean) then
30 local member = app.access_token.member
31 result.member = json.object{
32 id = member.id,
33 name = member.name
34 }
35 if app.access_token.session and app.access_token.session.real_member then
36 result.real_member = json.object{
37 id = app.access_token.session.real_member.id,
38 name = app.access_token.session.real_member.name,
39 }
40 end
41 if app.scopes.identification then
42 result.member.identification = member.identification
43 if app.access_token.session and app.access_token.session.real_member then
44 result.real_member.identification = app.access_token.session.real_member.identification
45 end
46 end
47 end
48 end
50 result.result = r
52 slot.put_into("data", json.export(result))
53 slot.put_into("data", "\n")

Impressum / About Us