I'm trying to use Deadbolt2 in a play2 application and i'm stuck with the implementation of getRolesHolder() in my Deadbolt Handler.
In the sample application, there is this example :
public class MyDeadboltHandler extends AbstractDeadboltHandler
{
public RoleHolder getRoleHolder()
{
// in a real application, the user name would probably be
// in the session following a login process
return User.findByUserName("steve");
}
}
My problem is : how can I get the session in getRoleHolder() ?
I've tried to call Context.current().session(); but I've got the following error :
There is no HTTP Context available from here.
Any ideas ?
Thanks