Hi, i have tried to disable/hide component like buttons (as Warren example) 
with success.
but how to Wicket tree not populateTreeItem( hide) because my Class Page not 
include in my hive file?
Does anyone can do it? or my way that call all menu from db for all principals 
then lets wicket security hide unsecured link is wrong method?

any hints/example will be appreciated. thanks


--- Pada Jum, 17/7/09, Warren Bell <[email protected]> menulis:

> Dari: Warren Bell <[email protected]>
> Judul: Re: How to Hidden/Disabled Wicket tree with implementation wicket 
> security
> Kepada: "Rizal Indra" <[email protected]>, [email protected]
> Tanggal: Jumat, 17 Juli, 2009, 10:50 AM
> 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 <[email protected]>
> menulis:
> > 
> >   
> >> Dari: Warren Bell <[email protected]>
> >> Judul: Re: How to Hidden/Disabled Wicket tree with
> implementation wicket security
> >> Kepada: [email protected],
> [email protected]
> >> 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: [email protected]
> >>> For additional commands, e-mail: [email protected]
> >>> 
> >>>       
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >> 
> >> 
> >>     
> > 
> > 
> >       Berbagi foto Flickr
> dengan teman di dalam Messenger. Jelajahi Yahoo! Messenger
> yang serba baru sekarang! http://id.messenger.yahoo.com
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 


      Berbagi video sambil chatting dengan teman di Messenger. Sekarang bisa 
dengan Yahoo! Messenger baru. http://id.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to