dispatch action and security

Dan Allen <[email protected]> Fri, 21 Mar 2003 09:54:51 -0600
Newsgroups gmane.comp.java.securityfilter.user
Message-ID <[email protected]>
When beginning struts, every tutorial sort of goes over the fact
that each action must map to an Action class.  But as projects get
larger, it makes more sense to try to group certain Actions together
into a class.  This is possible by using Dispatch action.  However,
since dispatch action is based on a URL request, it brings up an
interesting point...how do deal with security.

It was easy before to setup roles for each of the following actions

/ViewArticle
/EditArticle
/DeleteArticle

But with dispatch action it would become

/Article?method=view
/Article?method=edit
/Article?method=delete

Does it undermine security filter to use dispatch action and if it
doesn't, what guarantee do you have that the parameter will come
first for method in the list of parameters (for pattern matching).

This brings up another question.  If filters are supposed to handle
security, what about actions that need to do different things on
different roles.  Consider the following,

/EditArticle?id=1
/EditArticle?id=2

In order to edit an article you must be logged in, so it is easy to
slap on the requirment that the user must be in the 'member' or
'admin' role to even visit this url.  But in the case of editing
articles, you can only edit an article you wrote if you are a
'member', but an 'admin' can edit any article.  So now this must
have to fall down into the action.

Am I thinking about this right?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[email protected]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"This is a test of the Emergency Broadcast System.  If this had 
been an actual emergency, do you really think we'd stick around 
to tell you?"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en