You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Thiago H. de Paula Figueiredo" <th...@gmail.com> on 2009/03/25 03:23:05 UTC

Tapestry-Spring-Security and Tapestry 5.1.0.x

Hi!

Is it just me or Tapestry-Spring-Security doesn't work with Tapestry  
5.1.0.x? I tried to use the @Secured annotation in a class, using a  
non-existent role, and the page was rendered normally when it should  
redirect to the login page. Changing to T5.0.18 makes everything work as  
expected.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry-Spring-Security and Tapestry 5.1.0.x

Posted by "Juan E. Maya" <ma...@gmail.com>.
i was also having issues with spring-security. The @secured annotation is
not being processed however u could still secured the pages contributing the
FilterSecurityInterceptor.
I was able to find out why the annotation was not being processed,l i am
still trying to understand some of  the ioc behaviors.

On Wed, Mar 25, 2009 at 4:27 AM, Anthony Schexnaildre <ap...@gmail.com>wrote:

> Someone else mentioned that they were having issues with the same thing no
> more than a week ago. I don't remember them having a solution either.
>
> -Anthony
>
>
> On Mar 24, 2009, at 10:23 PM, Thiago H. de Paula Figueiredo wrote:
>
>  Hi!
>>
>> Is it just me or Tapestry-Spring-Security doesn't work with Tapestry
>> 5.1.0.x? I tried to use the @Secured annotation in a class, using a
>> non-existent role, and the page was rendered normally when it should
>> redirect to the login page. Changing to T5.0.18 makes everything work as
>> expected.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

Re: Tapestry-Spring-Security and Tapestry 5.1.0.x

Posted by Anthony Schexnaildre <ap...@gmail.com>.
Someone else mentioned that they were having issues with the same  
thing no more than a week ago. I don't remember them having a solution  
either.

-Anthony

On Mar 24, 2009, at 10:23 PM, Thiago H. de Paula Figueiredo wrote:

> Hi!
>
> Is it just me or Tapestry-Spring-Security doesn't work with Tapestry  
> 5.1.0.x? I tried to use the @Secured annotation in a class, using a  
> non-existent role, and the page was rendered normally when it should  
> redirect to the login page. Changing to T5.0.18 makes everything  
> work as expected.
>
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


Re: Tapestry-Spring-Security and Tapestry 5.1.0.x

Posted by ningdh <ni...@gmail.com>.
What I do is add the SetupRender phase in my ComponentClassTransformWorker. For I don't used T-S-S and don't know its source code at all, I am not sure whether it is like my solution.

My complete transform worker is below:

public class SecurityWorker implements ComponentClassTransformWorker{

 private SecurityChecker checker;
 public SecurityWorker(SecurityChecker checker){
  this.checker= checker;
 }

 public void transform(ClassTransformation transformation, MutableComponentModel model) {

  Secured annotation = transformation.getAnnotation(Secured.class);
        if (annotation == null)
            return;
        String checker=transformation.addInjectedField(SecurityChecker.class, "_$checker", checker);
        String pageSecurity=transformation.addInjectedField(Secured.class, "_$page_security", annotation);
        transformation.extendMethod(
                TransformConstants.SETUP_RENDER_SIGNATURE,String.format("%s.check(%s);",checker,pageSecurity));

       model.addRenderPhase(SetupRender.class); 
 }
}

'model.addRenderPhase(SetupRender.class);' is the one that I added after upgrading to 5.1.

Hope it helps.

Thanks,
DH

----- Original Message ----- 
From: "Thiago H. de Paula Figueiredo"
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Thursday, March 26, 2009 9:55 PM
Subject: Re: Tapestry-Spring-Security and Tapestry 5.1.0.x


> On Wed, Mar 25, 2009 at 4:18 AM, DH wrote:
>> Maybe caused by MutableComponentModel#addRenderPhase?
>> I don't use T-S-S, but have another role annotation based solution. I can work before 5.0.18 too but fail when upgrade to 5.1.0.0.
>> I need call MutableComponentModel#addRenderPhase to make it work at the end of the security transformerworker.
> 
> Could you give an example? I tried it, adding both @SetupRender and
> @PageAttached, but they didn't work.
> 
> -- 
> Thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>

Re: Tapestry-Spring-Security and Tapestry 5.1.0.x

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, Mar 25, 2009 at 4:18 AM, DH <ni...@gmail.com> wrote:
> Maybe caused by MutableComponentModel#addRenderPhase?
> I don't use T-S-S, but have another role annotation based solution. I can work before 5.0.18 too but fail when upgrade to 5.1.0.0.
> I need call MutableComponentModel#addRenderPhase to make it work at the end of the security transformerworker.

Could you give an example? I tried it, adding both @SetupRender and
@PageAttached, but they didn't work.

-- 
Thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry-Spring-Security and Tapestry 5.1.0.x

Posted by DH <ni...@gmail.com>.
Maybe caused by MutableComponentModel#addRenderPhase?
I don't use T-S-S, but have another role annotation based solution. I can work before 5.0.18 too but fail when upgrade to 5.1.0.0.
I need call MutableComponentModel#addRenderPhase to make it work at the end of the security transformerworker.

Thanks,
DH


----- Original Message ----- 
From: "Thiago H. de Paula Figueiredo" 
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Wednesday, March 25, 2009 10:23 AM
Subject: Tapestry-Spring-Security and Tapestry 5.1.0.x


> Hi!
> 
> Is it just me or Tapestry-Spring-Security doesn't work with Tapestry  
> 5.1.0.x? I tried to use the @Secured annotation in a class, using a  
> non-existent role, and the page was rendered normally when it should  
> redirect to the login page. Changing to T5.0.18 makes everything work as  
> expected.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>