Demonstrates how to use a single command to assign multiple Members to a Scope along with Scope-specific roles each Member will have for the target Scope.
For the context of this example, the following request will setup the instance with the needed starting conditions:
[
{
"from": "Member",
"filter": [
"Name='scopeListMember1','scopeListMember2'"
],
"execute": "Delete"
},
{
"AssetType": "Scope",
"Name": "Project for List of Members",
"Parent": "Scope:0",
"BeginDate": "2019-11-01T17:39:16.040Z"
},
{
"AssetType": "Member",
"Name": "scopeListMember1",
"Password": "scopeListMember1",
"Nickname": "scopeListMember1",
"Username": "scopeListMember1",
"DefaultRole": "Role.Name'Observer"
},
{
"AssetType": "Member",
"Name": "scopeListMember2",
"Password": "scopeListMember2",
"Nickname": "scopeListMember2",
"Username": "scopeListMember2",
"DefaultRole": "Role.Name'Observer"
}
]
The following request invokes the behavior:
{
"from": "Scope:1096",
"execute": {
"op": "AssignMemberWithRole",
"list": [
{
"Member": "Member:1097",
"Role": "Role:3",
"IsOwner": true
},
{
"Member": "Member:1098",
"Role": "Role:7",
"IsOwner": false
}
]
}
}
Expect a result similar to this:
{
"requestId": "6818598f-afc4-419b-9829-2be58cf56557",
"createdDate": "2019-11-01T17:39:16.2306754Z",
"completedDate": "2019-11-01T17:39:16.2486756Z",
"duration": "00:00:00.0180002",
"durationSeconds": 0.018000199999999997,
"complete": true,
"processing": false,
"assetsCreated": {
"oidTokens": [],
"count": 0
},
"assetsModified": {
"oidTokens": [],
"count": 0
},
"assetsOperatedOn": {
"oidTokens": [
"Scope:1096",
"Scope:1096"
],
"count": 2
},
"commandFailures": {
"commands": [],
"count": 0
},
"queryResult": {
"results": [],
"count": -1
}
}