Fix demo with new OIDC conformant mode

Since the `groups` are not sent in JWT payload anymore, Doorman returns
a list of principals that only contains the userid.

Ref #55
This commit is contained in:
Mathieu Leplatre 2017-12-04 17:19:38 +01:00
Родитель 5037c8fab4
Коммит 4d9b181c57
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 767B105F81A15CDD
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -60,8 +60,8 @@ def hello():
@authorized(resource="record", action="list")
def records():
authz = _app_ctx_stack.top.authz
email_principal = authz["principals"][1]
records = Records.list(author=email_principal)
main_principal = authz["principals"][0]
records = Records.list(author=main_principal)
return jsonify(records)
@ -88,8 +88,8 @@ def record(name):
# Save content on PUT
if request.method == "PUT":
body = request.data.decode("utf-8")
email_principal = authz["principals"][1]
record = Records.save(name, body, email_principal)
main_principal = authz["principals"][0]
record = Records.save(name, body, main_principal)
return jsonify(record)