This content has been marked as final.
Show 3 replies
-
1. Re: Seam 2.1; currentUser or identity?
jensaug.jens.augustsson.eu Dec 17, 2008 11:47 AM (in response to chris.simons)Sure.
If U accept a database hit instead of keeping the instance in the Session context, check out
UsingEntityHomeForEntitiesInLongrunningContextsAnd if you use new fresh JpaIdentityStore, you can get your hands on that user id by listening to an Event:
(this example uses our domain specific user EntityProcessUser
)@Observer(JpaIdentityStore.EVENT_USER_AUTHENTICATED) public void onAuthenticated(ProcessUser u) { Contexts.getSessionContext().set("currentUserId", u.getId()); }
...if U use jBPM you may also in this method map domain specific roles to the Actor roles/ group actor ids.
/Jens
-
2. Re: Seam 2.1; currentUser or identity?
chris.simons Dec 17, 2008 3:12 PM (in response to chris.simons)Cool, thanks - especially for the jBPM reference since we need to do something just like that.
-
3. Re: Seam 2.1; currentUser or identity?
mocha Dec 17, 2008 6:13 PM (in response to chris.simons)it's also possible to extend the seam Identity to add userId which keeps this all nicely in one place. currentUser can be factory generated as per the link above.