Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
securityMetadata.getCreatePrincipals();
try
{
if (!sm.authorize(conn.getUsername(), principals))
{
String msg = "User: " + conn.getUsername() +
" is not authorized to " +
(checkType == CheckType.READ ? "read from" :
checkType == CheckType.WRITE ? "write to" : "create durable sub on") +