How do I do the equivalent of Daml Script’s submitUser using the Java Bindings?
There is nothing builtin for that. But you can relatively easily write your own wrapper:
You can use listUserRights
to query the rights of the given user and then extract the actAs and readAs rights from that and put those parties in the actAs
and readAs
arguments of submit.
That said, ime you’re usually better off specifying the parties explicitly instead of inferring them this way. Often you only need a subset of the rights of your users and seeing that explicitly in the code can make it easier to read and you avoid accidentally passing more rights than you intended.
1 Like