For adding an assignment for a role you will need to gather a bit of information first which can be done in Restman calls.
1) Call to get the unique id for the Operator role(Note that the operator role is a built in role so the ID should be the same on each system)
https://<gateway FQDN>:8443/restman/1.0/roles?name=Operator
Apart you are looking for
...
<l7:Item>
<l7:Name>Operator</l7:Name>
<l7:Id>0000000000000000ffffffffffffff6a</l7:Id>
....
2) Call to get the Identity provider ID for the user:
https://<gateway FQDN>:8443/restman/1.0/users?login=foo
...
<l7:Resource>
<l7:User providerId="0000000000000000fffffffffffffffe"...
3) Update the Assignment by using a PUT method with application/xml as the Content-type
Payload: https://<gateway FQDN>:8443/restman/1.0/roles/0000000000000000ffffffffffffff6a/assignments
Sample Template:https://<gateway FQDN>:8443/restman/1.0/roles/0000000000000000ffffffffffffff6a/assignments/template/addassignments
<l7:AddAssignmentsContext xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:assignments>
<l7:assignment>
<l7:providerId>0000000000000000fffffffffffffffe</l7:providerId>
<l7:identityName>Foo</l7:identityName>
<l7:entityType>User</l7:entityType>
</l7:assignment>
</l7:assignments>
</l7:AddAssignmentsContext>
Sincerely,
Stephen Hughes
CA Support