You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by daniel alonso <al...@gmail.com> on 2008/04/11 09:43:14 UTC

Controlling acccess to different users by profile

First of all, thanks for all the support given through this mailing list.
I'm a newbie in this framework and after reading a couple of book and the
wiki, I have a question concerning about this:

I want to control the access to pages by user's role. I've checked the
tapestry example about how to authenticate a user and restrict its access to
the private area but, .. is there any way of put the access ckeck in a
parent class or something like that. I'm thinking about that because maybe
put this in each page


    @ApplicationState
    private    User user;
    private boolean userExists;
    //    estos dos van de la mano con el nombre
    Object onActivate() {
        if (!userExists)
            return Start.class;
        return null;
    }




could be a bit annoying. May anyone tell a nice way to do it? Any kind of
help would be very appreciated ;D

Thanks in advance to all.

Re: Controlling acccess to different users by profile

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

Take a look at 
http://www.nabble.com/T5%3ALogin-and-session-to12276631.html#a12276933
sample here , I used that approach, it works, but eventually I use the
approach in the wiki, dispatcher approach, I'd suggest you go with
dispatcher.

Angelo


daniel alonso-3 wrote:
> 
> First of all, thanks for all the support given through this mailing list.
> I'm a newbie in this framework and after reading a couple of book and the
> wiki, I have a question concerning about this:
> 
> I want to control the access to pages by user's role. I've checked the
> tapestry example about how to authenticate a user and restrict its access
> to
> the private area but, .. is there any way of put the access ckeck in a
> parent class or something like that. I'm thinking about that because maybe
> put this in each page
> 
> 
>     @ApplicationState
>     private    User user;
>     private boolean userExists;
>     //    estos dos van de la mano con el nombre
>     Object onActivate() {
>         if (!userExists)
>             return Start.class;
>         return null;
>     }
> 
> 
> 
> 
> could be a bit annoying. May anyone tell a nice way to do it? Any kind of
> help would be very appreciated ;D
> 
> Thanks in advance to all.
> 
> 

-- 
View this message in context: http://www.nabble.com/Controlling-acccess-to-different-users-by-profile-tp16626816p16628151.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Controlling acccess to different users by profile

Posted by daniel alonso <al...@gmail.com>.
Fantastic!Thanks a lot to both of you :D. I will give a try to them

2008/4/11, Thiago HP <th...@gmail.com>:
>
> On 4/11/08, Marcelo Lotif <ml...@gmail.com> wrote:
> > There are two nice articles by Chris Lewis regarding this, and i think
> it's
> >  the best approach out there. Maybe you should give a try:
> >
> >  http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher
> >  http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2
>
>
> You could also try the Tapestry5-Acegi integration:
> http://www.localhost.nu/java/tapestry5-acegi/. That's my preferred way
> to do it.
>
> --
>
> Thiago
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Controlling acccess to different users by profile

Posted by Thiago HP <th...@gmail.com>.
On 4/11/08, Marcelo Lotif <ml...@gmail.com> wrote:
> There are two nice articles by Chris Lewis regarding this, and i think it's
>  the best approach out there. Maybe you should give a try:
>
>  http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher
>  http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2

You could also try the Tapestry5-Acegi integration:
http://www.localhost.nu/java/tapestry5-acegi/. That's my preferred way
to do it.

-- 
Thiago

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


Re: Controlling acccess to different users by profile

Posted by Marcelo Lotif <ml...@gmail.com>.
There are two nice articles by Chris Lewis regarding this, and i think it's
the best approach out there. Maybe you should give a try:

http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher
http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2

=)

2008/4/11, daniel alonso <al...@gmail.com>:
>
> First of all, thanks for all the support given through this mailing list.
> I'm a newbie in this framework and after reading a couple of book and the
> wiki, I have a question concerning about this:
>
> I want to control the access to pages by user's role. I've checked the
> tapestry example about how to authenticate a user and restrict its access
> to
> the private area but, .. is there any way of put the access ckeck in a
> parent class or something like that. I'm thinking about that because maybe
> put this in each page
>
>
>     @ApplicationState
>     private    User user;
>     private boolean userExists;
>     //    estos dos van de la mano con el nombre
>     Object onActivate() {
>         if (!userExists)
>             return Start.class;
>         return null;
>     }
>
>
>
>
> could be a bit annoying. May anyone tell a nice way to do it? Any kind of
> help would be very appreciated ;D
>
> Thanks in advance to all.
>



-- 
Atenciosamente,
Marcelo Lotif