Thanks for all the replies.

I had it the way Thiago has mentioned, but I wanted to avoid passing
arguments, since I was using more than two services in this util class,
sometimes the long argument list was looking messy.

I am using spring security and it allowed something like this - 

Authentication auth =
SecurityContextHolder.getContext().getAuthentication();

Which allowed me to create a handy UserRole class in which I have static
functions which use the authentication handle.

public static boolean isRoleSuper() {
  
}
        
public static boolean isRoleAdmin() {

}

So in my pages I can just say 
if(UserRole.isRoleSuper())

without passing the authentication handler as argument.  This was very handy
as there is a need to do stuff based on user role in many pages.







-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/how-to-get-a-handle-to-a-service-from-a-POJO-class-tp3329328p3330652.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to