Grails JMS Message failed to add permission using Spring Security
<p>I have a JMS Message Listner, which gets the message properly from controllers.</p>

<p>The method looks like</p>

<pre><code>@Override
public void onMessage(Message message) {
try {
    def data
    if (message instanceof TextMessage) {
    data =  ((TextMessage)message).getText();
    onNotificationService.testIt(new JSONObject(data))
    }
    else {
    println "Message "+message
    }
} catch (JMSException e) {
    throw new RuntimeException(e);
}

}
</code></pre>

<p>The data then being sent to the method <code>testIt</code> where I am doing my operation. One of the operation is to add permission some data which been processed from this data.
For that, I am using this -</p>

<pre><code>aclUtilService.addPermission(myObject, username, BasePermission.ADMINISTRATION)
</code></pre>

<p>I am getting an exception here as <code>Authentication Required</code>
This works perfectly if <code>onNotificationService.testIt(new JSONObject(data))</code> been called directly from <code>controller</code>, it works perfect.</p>

<p>What I am missing?</p>

<p>Any help on this highly appreciated. </p>