The session relevance inspector
current console user properly returns the correct
bes user when used in the console, but it does not provide a correct result through the REST API and there is no equivalent alternative for the REST API.
It is very useful to be able to dynamically determine the
current bes user from the context of a session relevance query so that you don’t have to hardcode a particular user, which would is much less than ideal.
An example use case is if you want to stop a user’s existing action automatically. Actions can only be stopped by the user who created the action, or a master operator. This means in most cases, if you want to automate the stopping of older actions, then it is only possible to do this for the current user’s actions.
Here is an example from the bes console:
Q: name of current console user
Example using the REST API:
curl -k --user jgstew --data-urlencode relevance="name of current console user" https://_ROOT_SERVER_:52311/api/query
<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<Query Resource="name of current console user">
<Error>Singular expression refers to nonexistent object.</Error>
This should instead return: