@Override
    public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {

        //Unlike when adding a producer, consumers must specify the destination at creation time, so we can rely on
        //a destination being available to perform the authz check:
        DestinationAction action = new DestinationAction(context, info.getDestination(), "read");
        assertAuthorized(action, "read from");

        return super.addConsumer(context, info);
    }
@Test(expected=UnauthorizedException.class)
    public void testAddConsumerNotAuthorized() throws Exception {
        String name = "myTopic";
        ActiveMQDestination dest = new ActiveMQTopic(name);

        Subject subject = new PermsSubject();
        ConnectionContext context = createContext(subject);
        ConsumerInfo info = new ConsumerInfo(null);
        info.setDestination(dest);

        filter.addConsumer(context, info);
    }