What I did was create a @Privileged annotation.  The annotation value was
the name of the required role. You could attach this method to classes, or
to methods.  @Privileged is inherited, and @Privileged("") means no special
privilege required.

For classes, it implemented/extended PageValidateListener to check the
permission.

For methods, it overrided the method to add a check before invoking super().

I extended Tapestry class and method annotation workers to handle these
annotations.

Worked like a charm.

This approach puts the logic right into the pages or methods, which is where
I think it belongs.

On 6/7/06, James Carman <[EMAIL PROTECTED]> wrote:

All,

You guys are the experts.  I have a design question.  I am creating a
tapestry/acegi integration package (parts of it are already done).  What I
need to figure out is how to decide what roles an in-coming request
requires?  If it's a PageService request, I can check the page class for a
@RequiredRole annotation.  If it's a DirectService request, I can check
the
method for a @RequiredRole annotation.  But, how do I do this in a general
way?  Any ideas?

James



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




--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

Reply via email to