Dari: Warren Bell <warrenbe...@gmail.com>
Judul: Re: How to Hidden/Disabled Wicket tree with implementation wicket
security
Kepada: users@wicket.apache.org, bujang_kuan...@yahoo.com
Tanggal: Kamis, 16 Juli, 2009, 11:09 AM
Try this:
Warren
public class SecureWebMarkupContainer extends
WebMarkupContainer implements ISecureComponent {
public SecureWebMarkupContainer(String
id)
{
super(id);
setSecurityCheck(new
ComponentSecurityCheck(this));
}
public
SecureWebMarkupContainer(String id, IModel model)
{
super(id, model);
setSecurityCheck(new
ComponentSecurityCheck(this));
}
public final void
setSecurityCheck(ISecurityCheck check)
{
SecureComponentHelper.setSecurityCheck(this,
check);
}
public final ISecurityCheck
getSecurityCheck()
{
return
SecureComponentHelper.getSecurityCheck(this);
}
public boolean isActionAuthorized(String
action)
{
return
SecureComponentHelper.isActionAuthorized(this, action);
}
public boolean
isActionAuthorized(WaspAction action)
{
return
SecureComponentHelper.isActionAuthorized(this, action);
}
public boolean isAuthenticated()
{
return
SecureComponentHelper.isAuthenticated(this);
}
public boolean
isAuthenticatedAndAuthorized(String action)
{
return isAuthenticated()
&& isActionAuthorized(action);
}
{
Rizal Indra wrote:
Hi,
I have created my welcome page with menu tree
(http://wicketstuff.org/wicket13/nested/ ). I want to
hide/disabled some item menu depend on user right
principal.
I have try put some tricks but not work :-)
MyTree.java
public class MyTree extends Tree {
@Override
protected void
populateTreeItem(WebMarkupContainer item, int level) {
System.out.println(" getting
populateTreeItem...");
super.populateTreeItem(item, level);
final TreeNode
node = (TreeNode)item.getModelObject();
MarkupContainer
nodeLink = newNodeLink(item, "nodeLink", node);
SecureWebMarkupContainer swmc = new
SecureWebMarkupContainer("hiddenMenu");
swmc.add(nodeLink);
//item.add(nodeLink);
item.add(swmc);
}
}
SecureWebMarkupContainer.java
public class SecureWebMarkupContainer extends
WebMarkupContainer implements ISecureComponent {
...
}
can anyone give some example/advice how to make it
work. thanks
Pemanasan global? Apa
sih itu? Temukan jawabannya di Yahoo! Answers! http://id.answers.yahoo.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