enclosures work on the visibility level, not render level. since your
adminlink is visible, but its rendering is aborted the enclosure still
shows the content.

to do this you have to put the link into a webmarkupcontainer, and
authorize that container instead of a link.

-igor


On 10/31/07, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a main menu with an admin link which only renders when the user
> has the "ADMIN" role (MainMenu.java):
>
>    final BookmarkablePageLink adminLink = new
> BookmarkablePageLink("adminLink", AdminHomePage.class);
>    MetaDataRoleAuthorizationStrategy.authorize(adminLink, RENDER, "ADMIN");
>    add(adminLink);
>
> In my MainMenu.html I have:
>
> <wicket:enclosure id="adminLink">
>    <li>
>      <a wicket:id="adminLink">Administratie</a>
>    </li>
> </wicket:enclosure>
>
> I was hoping that when the admin link is not rendered due to the user
> not having the proper role, that the <li></li> would also not be
> rendered, however, it does not seem to work this way...
>
> Is this not the way I'm supposed to do this? Or should this work?
> Otherwise, what is the right way to go about this?
>
> Thanks in advance,
> Sebastiaan
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to