@@ -165,12 +165,12 @@ public async Task<IActionResult> CreateResourceRequest(
165165 Per (by) ber om tilgang for Kari (for) til App (resource) hos Org (at).
166166 */
167167 var result = await requestService . CreateResourceRequest (
168- toId : to ,
169- fromId : party ,
170- byId : authUserUuid ,
168+ toId : to ,
169+ fromId : party ,
170+ byId : authUserUuid ,
171171 roleId : RoleConstants . Rightholder . Id ,
172- resourceId : resourceObj . Id ,
173- status : RequestStatus . Pending ,
172+ resourceId : resourceObj . Id ,
173+ status : RequestStatus . Pending ,
174174 ct : ct
175175 ) ;
176176
@@ -410,20 +410,21 @@ private async Task<IActionResult> ApproveResourceRequest(Guid partyUuid, Guid au
410410
411411 var from = await entityService . GetEntity ( request . From . Id , ct ) ;
412412 var to = await entityService . GetEntity ( request . To . Id , ct ) ;
413+ var authUser = await entityService . GetEntity ( authUserId , ct ) ;
413414 var resource = await resourceService . GetResource ( request . Resource . Id . Value , ct ) ;
414415
415- var assignment = await assignmentService . GetOrCreateAssignment ( from . Id , to . Id , RoleConstants . Rightholder , cancellationToken : ct ) ;
416+ var assignment = await assignmentService . GetOrCreateAssignment ( to . Id , from . Id , RoleConstants . Rightholder , cancellationToken : ct ) ;
416417 if ( assignment is null )
417418 {
418419 return Problem ( "Unable to get or create rightholder assignment" ) ;
419420 }
420421
421422 var result = await connectionService . AddResource (
422- from ,
423423 to ,
424+ from ,
424425 resource ,
425426 new RightKeyListDto { DirectRightKeys = rightKeys } ,
426- party ,
427+ authUser ,
427428 ConfigureConnections ,
428429 ct ) ;
429430
0 commit comments