Provide explicit party ctx through orgmgmt stub (#15)

This commit is contained in:
Andrew Mayorov 2021-01-29 13:06:52 +03:00 committed by GitHub
parent c0e85ff764
commit e81966c411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,8 @@
-export([handle_function/4]).
-define(THRIFT_TYPE,
{struct, struct, {bouncer_context_v1_thrift, 'ContextFragment'}}).
{struct, struct, {bouncer_context_v1_thrift, 'ContextFragment'}}
).
-spec handle_function(woody:func(), woody:args(), woody_context:ctx(), woody_state:st()) ->
{ok, woody:result()}.
@ -17,10 +18,13 @@ handle_function('GetUserContext', {UserID}, _WoodyCtx, _Opts) ->
ContextFragmentV1 = #bctx_v1_ContextFragment{
user = #bctx_v1_User{
id = UserID,
orgs = [#bctx_v1_Organization{
id = UserID,
owner = #bctx_v1_Entity{id = UserID}
}]
orgs = [
#bctx_v1_Organization{
id = UserID,
owner = #bctx_v1_Entity{id = UserID},
party = #bctx_v1_Entity{id = UserID}
}
]
}
},
{ok, #bctx_ContextFragment{