Put the method which checks for permissions in a Hivemind service. Then extend each link component with the same thing:
inject the service, add the credential parameter, let the hivemind service decide if super.renderComponent will be called... just an idea... Cheers, ROn ציטוט Vinicius Carvalho:
Hello there folks. I'm developing new Link Components based on the existent ones. The main diference here is that they may or may not render, depending on the user credentials. First I was wondering if this is already possible. Second, if not I'm dueling with a conflict here. I've created a Base abstract class that checks for the permissions, and returns true/false on a canRender() method. I use this method on the renderComponent of my links. The problem is, since Tapestry has many links components (Direct,Extenal,Page,Generic) I was re-implementing them all. I know I could do this using aspects in a very easy fashionable way by using around advice on my components. But as I'm creating components to be shared using a library, I don't want to add another layer of dependency in a AOP framework. What you guys think would be the best approach here? Regards -- Vinicius Caldeira Carvalho Arquiteto de Sistemas [EMAIL PROTECTED] www.synos.com.br <http://www.synos.com.br> "Everything should be made as simple as possible, but not simpler." Albert Einstein
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
