AnsweredAssumed Answered

Constraint - Getting current user

Question asked by matjazmuhic on Oct 8, 2010
Latest reply on Oct 11, 2010 by matjazmuhic
So, here's the thing…

I have implemented custom lucene search based constraint in Java where I used admin:admin to for authentication with AuthenticationService. Now I'm wondering how could I get current logged-in user and check if the user has permissions to read the nodes returned from lucene search.

I tried some things but I think it didn't work cause constraint class is loaded before anyone is logged in so there's no current user. Is it ok to just skip everything until I can get current user?

Can I get current user from my custom constraint or should I implement this using maybe jsf managed bean (just my blind guess) or any other way?

Outcomes