I don't think you can do that in SimpleXML, but I am not sure.
| rest /services/authentication/current-context/context | fields username roles
to get the current user name and the roles that user is part of (can be multiple) and then set the refresh property.
Note: I have not tested whether dynamically setting the refresh property will actually work, or whether the value is only read once when the dashboard loads.
Easy enough to try.