title: Java Tibco EMS get queue list without using TibjmsAdmin
body: <p>I am using the following code to establish a connection to tibco ems. </p>
  
  <pre><code>TibjmsQueueConnectionFactory factory = new TibjmsQueueConnectionFactory(server.url, null, environment);
  
  QueueConnection connection = factory.createQueueConnection(server.user, server.password);       
  QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
  
  TibjmsAdmin = new TibjmsAdmin(server.url, server.user, server.password, environment);
  
  QueueInfo[] queueInfo = admin.getQueues();
  </code></pre>
  
  <p>The <code>getQueues</code> request throws exception that the user is not authorized to execute the command. Before going ahead with a request to their admin (this ems belongs to another company), I would like to clarify few things so that I can avoid an outright denial of permission.</p>
  
  <p>1) By any chance a user who is able to connect to the server can list the queues without using the TibjmsAdmin interface? I read about JNDI lookups, but could not find any complete example for EMS. Can this JNDI achieve this, using only the connection permission?</p>
  
  <p>2) Can the EMS administrator permit listing of only a subset of queues to a user, which the <code>admin.getQueues()</code> can retrieve? I read about pattern based permission. Could someone give an example of the <code>grant</code> command the EMS admin would use to do that?</p>
  
  <p>3) What command does the ems admin use to grant <code>show queues</code> permission to a user. I have installed a trial version of ems server. I could give <code>all</code> admin privileges to another user, but not the minimum required permission to do a <code>show queues</code>. I have tried almost all possible combinations I could think of, but to no avail.</p>
  
  <p>Appreciate any help.</p>