Hi,

Look at the wicket-examples source code for:org.apache.wicket.examples.authentication.MyAuthenticatedWebSession

This uses 'wicket-auth-roles' artifact and will give you the login detection and role information for the current user once you application is setup in the same way.

Then on your page or panel override onBeforeRender and (do what Martin suggests) conditional show/hide your content.

@Override
protected void onBeforeRender() {

     if (getSession().isSignedIn()) {

            Roles roles = getSession().getRoles();

            if (roles != null && roles.contains(Roles.ADMIN)) {
                adminPanel.setVisibilityAllowed (true);
            }
            else
                adminPanel.setVisibilitiyAllowed(false);

        userPanel.setVisibilityAllowed(true);

    }
    else {
        userPanel.setVisibilityAllowed (false);

    }

        super.onBeforeRender();
}

Regards,

Mike

Hi,

how can I display navigation points and page content depending on the login
status?
I have a login box and only after a sucessfully authentication I want to

1.) extend the existing navigation
2.) make content visible on (already) "public" sites

Seems like I have to create my own Session object (or is there already one
given with wicket?) and need to check whether a user is already logged in or
not?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3384641.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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

Reply via email to