I have a EJB 3 application as a service layer and a Tapestry 5 web application as its client. The EJBs should provide a session facade for use by the web app.
To do the operations defined in the EJB layer, the user needs to log in trough the web interface. I must have entity level security, so Java EE declarative security is of little use to me here.
How should I implement security in this kind of setup? I would rather have it implemented on the EJB layer, then in the web app, in case I switch clients.
I could use the http session in the web app to store the user session and then pass the User object in every stateless EJB call.
public void doStuff(params, User user);
Are stateful session beans the solution here?
Edit: By entity level security I mean row level security.