Skip to content
Discussions/App Development/How to create User with multiple party idsForum ↗

How to create User with multiple party ids

App Development5 posts256 views1 likesLast activity Feb 2023
MA
Mary_Glenda_JordasOP
Feb 2023

How to create User with multiple party ids

BE
bernhard
Feb 2023

You can do this in daml script like this:

multi_party_user : Script UserId
multi_party_user = script do
  p <- allocateParty "userprimaryparty"
  a1 <- allocateParty "useractasparty1"
  a2 <- allocateParty "useractasparty2"
  r1 <- allocateParty "userreadasparty1"
  r2 <- allocateParty "userreadasparty2"

  -- Set up a user
  userId <- validateUserId "myuser"
  createUser (User userId (Some p)) [CanActAs p, CanActAs a1, CanActAs a2, CanReadAs r1, CanReadAs r2]

  return userId

Via the API just use the Party and User Management services to take the same actions.

MA
Mary_Glenda_Jordas
Feb 2023

Do you have some sample codes how to do it via the API ?

MA
Mary_Glenda_Jordas
Feb 2023


There’s only one paryId in the navigator.

CO
cocreature
Feb 2023

Navigator only shows you the list of users and allows you to interact with the primary party of each user. At this point, Navigator does not allow you to interact with other parties that a user might have claims for.

If you want to use navigator for other parties, then create separate users that have those parties set as their primary party.

← Back to Discussions