How return forbidden in play framework 2 Java action composition

playframework-2.0

Solution

You need to return a `Promise<SimpleResult>`.

return F.Promise.pure((SimpleResult) forbidden());

Problem

I have created new action composition and in some cases i need return forbidden how to do it correctly ? ``` public class VerboseAction extends play.mvc.Action.Simple { public F.Promise<SimpleResult> call(Http.Context ctx) throws Throwable { Logger.debug(ctx.request().username()); //return delegate.call(ctx); return forbidden(); } ``` }

Original source