+ Start a Discussion
Haystack CertifiedHaystack Certified 

Determining Live Agent User in VF or Apex

Is there a way to determine if a user has Live Agent permissions?  I tried {!$User.USERPERMISSIONSLIVEAGENTUSER} which is what Data Loader returned, but it didn't work in the VF page.  Could not find it in the API doc for User either.  Thanks.
Karthik PKarthik P

Not sure whether you got the answer for this. But thought of replying although the question is couple of months old.

The one which you tried should work if you have queried the userpermissionsliveagentuser field in the VF page controller.

Below is sample code to check if the user is has live agent permissions or not.

VF Page:
<apex:page controller="DetermineLiveAgentController">
    <apex:pageblock >
        <apex:pageBlockSection >
            <apex:pageBlockTable value="{!usersList}" var="user">
                <apex:column value="{!user.name}"/>
                <apex:column value="{!user.userpermissionsliveagentuser}"/>

public class DetermineLiveAgentController {
    List<User> userList;
    public List<User> getUsersList() {
        userList = [ select id,name,userpermissionsliveagentuser from user ];
        if(userList != null){
            return userList;
        return null;

I have tested it and it works. 

Please mark this as answer if it has resolved your issue so that others may benefit.