A good practice is to use decelrative Container Managed Security.
This kind of implies you set it up in web.xml (via a /securePath/*) or via action mapping in struts config.


(writing you own security is not a good parctice, IMO)
hth,
V

(do not cofuse that with the non container based filter implementation of above available from sf.net)

Dan Allen wrote:
There have been several discussions on this list about how security
should be loosely coupled with the ActionServlet itself (a filter on
top of the application), but I am curious to know the best
practicing for handling the following type of case.

Assume I have an action with a path of /EditAccount.  Naturally if a
user is not logged in, this path should be protected via filtering.
However, /EditAccount has two purposes, one for the regular user to
edit his/her own account, but also for the administrator to edit any
user account via the query string ?user=username.  In this case, I
have to check in the action class if the user is allowed to take on
the role of another user in which case the form is populated with
that user's data or, if not, the form should populate with the
user's own data.

Is this something that is reasonable to do in the action, or should
I create another action path /EditUserAccount?user=username and
filter that to only admins and then forward to the /EditAccount once
the proper credientials have been established, hence relieving the
action behind /EditAccount from looking at any roles?

Dan




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



Reply via email to