Update: LA 1.37.x documentation now provides further and detailed insight into Agent Permissions.
How to use Agent Permissions
This article assumes that you are creating a custom Agent Console and Consumer Web App.
Creating a custom Agent Console: when provisioning a session and building up your JSON data, you can add a permissions
as a new name within the AED2.metadata
(which in turn, sits within additionalAttributes
). Within permissions
, you are able to add viewable
and interactive
and an array is to be passed in as the value for each.
Let's say for example we'd like a button on the Consumer side to be visible but not clickable or intractable in any way - in our viewable
array, we would add a permission marker (this can be called anything) and call it button
, just to give it a meaningful name. We will leave default permissions in the interactive
array, so we'll add default
in there as a value (we'll also add default
permissions in the viewable
array) - refer to the relevant LA documentation on default permissions.
Now that we've done all of that - we create our button in our custom Consumer sample and perhaps give it an ID to make easier for us to access it in JS e.g. <button id="button">Test Button</button>
. What's missing from the documentation is how to actually assign the permission marker that we made and associate that with an element in our page... so the function we'll call accepts two parameters: the permission marker and the element.
So perhaps on a call-back e.g. on screen share requesting, we can do the following: AssistSDK.setPermissionForElement('button', document.getElementById('button'));
and now this will apply permissions for button
to that element. During the screenshare, the Agent will see the button but not able to click on it or do anything else with it. The consumer is free to click it or anything else etc.
NOTE: Refer to the relevant LA documentation, mainly the table/matrix on various combinations of permissions as it can get confusing.
Consumer HTML Sample
<button type="submit" id="test">Test Button</button>
<input type="text" id="text">
<button id="go">Click here</button> to start an Assist Session.
Consumer JS Function calls - Assign Permission Markers
// This will make the test button unclickable, but viewable for the Agent
AssistSDK.setPermissionForElement('test', document.getElementById('test'));
// The Agent will no longer be able to view or do anything with this input field
AssistSDK.setPermissionForElement('text', document.getElementById('text'));
// The Agent will no longer be able to view or do anything with this button
AssistSDK.setPermissionForElement('go', document.getElementById('go'));
Once executed, the data-assist-permission
attributes are automatically assigned where relevant.
Agent-side Console - Provisioning Session - JSON Sample
{
"webAppId": "webapp-id-example",
"allowedOrigins": ["*"],
"urlSchemeDetails": {
"secure": %s,
"host": "%s",
"port": "%s"
},
"voice": {
"username": "%s",
"domain": "%s"
},
"additionalAttributes": {
"AED2.allowedTopic": "%s",
"AED2.metadata": {
"role": "agent",
"name": "Sherry",
"permissions": {
"viewable": ["test", "default"],
"interactive": ["go", "text", "default"]
}
}
}
}
Comments
0 comments
Please sign in to leave a comment.