In a word, no. There is no way to have CMA call your Action when a user logs
in. There are alternatives, however.

If all your requests go through Actions, you could add code to your app's
Action base class to ensure that the profile information is there. I think
there are more alternatives of where to put that kind of processing in the
1.1 version of Struts. Or you could create a filter that would look for
profile info, add it if the user is authenticated but there is no profile -- 
that would work no matter if your requests are all handled by Actions or
not. Or you could create a method that you would use to access the profile
info, and the method would create it just-in-time if it had not been
initialized yet.

I am not completely sure where you want to get the role information, but you
must setup the CMA to have access to your role info if you want other
software packages to be able to use that info. Those packages depend on
using the request.isUserInRole() method from the Servlet spec. That method
will work with a properly setup CMA system, or you can write a filter and
request wrapper to do a custom implementation. Your CMA system must have
access to the roles so that you can do url-pattern based declarative
security -- without being able to protect resources by url pattern, no users
will ever be authenticated.

I created an open-source filter and request wrapper implementation that
mimics container-managed security. You may find it useful as-is, or it could
be the base of a customized system if your app has needs that it or CMA does
not address:
http://securityfilter.sourceforge.net/

-Max

----- Original Message ----- 
From: "Mohan Radhakrishnan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 7:15 AM
Subject: CMA and LoginAction


> Hi
>
>        I would like to use role based authentication. That is CMA. Now I
> also want to call my Action class. The idea is to use
>
>  <logic:present role="name"/>
>
>  My Action class sets up user profiles based on the login ID etc. Is this
> possible ?
>
> Mohan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to