<div>
Great gist my friend! I was wondering about another alternative more simple. Currently AeroGear security implements HttpStatusAwareException (I'll rename to HttpStatusAware and qmx is responsible for the hipster name)
</div><div><br></div><div><div>public class AeroGearSecurityMeh implements HttpStatusAware {</div><div><br></div><div> @Override</div><div> public int getStatus() {</div><div> //something here</div><div> }</div><div><br></div><div> @Override</div><div> public String getMessage() {</div><div> //something here</div><div> }</div><div>}</div></div><div><br></div><div>Then in AeroGearSecurityProvider we could change the method return and do something like this:</div><div><br></div><div><div>public class AeroGearSecurityProvider implements SecurityProvider {</div><div><br></div><div> @Inject</div><div> private AeroGearPrincipal principal;</div><div><br></div><div> @Override</div><div> public AeroGearSecurityMeh isRouteAllowed(Route route) throws ServletException {</div><div><br></div><div> if (!principal.hasRoles(route.getRoles())) {</div><div> return new AeroGearSecurityMeh(1, "Geez, authentication has failed");</div><div> }</div><div> }</div><div>}</div></div>
<div><div><br></div><div>Wdyt? Makes sense?</div><div><br></div><div><div>-- </div><div>"The measure of a man is what he does with power" - Plato</div><div>-</div><div>@abstractj</div><div>-</div><div>Volenti Nihil Difficile</div></div></div>
<p style="color: #A0A0A8;">On Thursday, November 1, 2012 at 6:14 AM, Daniel Bevenius wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div><div>Hi,</div><div><br></div><div>I'm working on AEROGEAR-581 and have put together some background</div><div>information and some prototype code in this gist:</div><div><a href="https://gist.github.com/3992369">https://gist.github.com/3992369</a></div><div><br></div><div>If you read the conclusion section you'll see that I'm not convinced</div><div>that CDI events are a good fit in this specific situation, but I'd be</div><div>happy to learn otherwise :)</div><div><br></div><div>Thanks,</div><div><br></div><div>/Dan</div><div>_______________________________________________</div><div>aerogear-dev mailing list</div><div><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a></div><div><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>