You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pureza <pu...@gmail.com> on 2012/11/19 15:39:17 UTC

Disallowing a logged-in user to access some page

Hi,

How can I prevent access to certain pages (such as the sign-in page or the
account creation page) for logged-in users?

Right now I'm just adding a check to every such page and redirect to another
page if the user is signed-in, but I'd like to know if there is a cleaner
solution.

Thanks

Luis





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Disallowing-a-logged-in-user-to-access-some-page-tp4654000.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Disallowing a logged-in user to access some page

Posted by pureza <pu...@gmail.com>.
Hi Martijn,

Thanks for your reply. I am currently using wicket-shiro. Do you know if it
is possible to mix auth-roles and wicket-shiro in the same project?

Regards,

Luis



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Disallowing-a-logged-in-user-to-access-some-page-tp4654000p4654023.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Disallowing a logged-in user to access some page

Posted by Martijn Dashorst <ma...@gmail.com>.
Not sure how you have implemented your authorization stuff, but with
auth-roles it should be trivial to implement a @OnlyNotLoggedIn
annotation for your pages, and extend the authorization check to check
for the presence of that annotation.

Another way would be to register an OnBeforeRenderListener in your
application that performs this check and issues the redirect.

Martijn

On Mon, Nov 19, 2012 at 3:39 PM, pureza <pu...@gmail.com> wrote:
> Hi,
>
> How can I prevent access to certain pages (such as the sign-in page or the
> account creation page) for logged-in users?
>
> Right now I'm just adding a check to every such page and redirect to another
> page if the user is signed-in, but I'd like to know if there is a cleaner
> solution.
>
> Thanks
>
> Luis
>
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Disallowing-a-logged-in-user-to-access-some-page-tp4654000.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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