Your hive should have something like this with whatever actions you want:

permission ${ComponentPermission} "${MyPage}:myPanel:myForm:myWebMarkupContainer", "inherit, render, enable";

And also secure anything in the container like buttons:

permission ${ComponentPermission} "${MyPage}:myPanel:myForm:myWebMarkupContainer:myButton", "inherit, render, enable";

I seem to remember a similar problem that I had. It involved the way I used a WebMarkupContainer, a form and a panel. I messed around with how I nested the different components and I got it to work. Go figure?

Warren

Rizal Indra wrote:
Thanks for quick reply Warren,
exactly my code SecureWebMarkupContainer.java is same as with your code.
But its still not working. I am newbie in java wicket, so i need more example/hint for understanding its. I am sure that missing something but i dont know how to solve it.

Can anyone help me? thanks


--- Pada Kam, 16/7/09, Warren Bell <warrenbe...@gmail.com> menulis:

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




      Berbagi foto Flickr dengan teman di dalam Messenger. Jelajahi Yahoo! 
Messenger yang serba baru sekarang! http://id.messenger.yahoo.com


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

Reply via email to