Permission

"Pablo Rito" <[email protected]>
Newsgroups gmane.comp.java.struts-menu.user
Message-ID <[email protected]>
Hi I have problems with the Permission filter , I have used 

public class CustomePermissionsAdapter  implements PermissionsAdapter

{

    private ArrayList menuNames;

 

    public CustomePermissionsAdapter(String theMenuNames[])

    {

       menuNames = new ArrayList();

       if(theMenuNames != null)

       {

           for(int i = 0; i < theMenuNames.length; i++)

           {

               menuNames.add(theMenuNames[i]);

           }

       }

   }

 

   public boolean isAllowed(MenuComponent menu)

   {

       return !menuNames.contains(menu.getName());

   }

 

}

 

And in  

 

   if (menus != null)

           {

               for (int i = 0; i < menus.length; i++)

                   System.out.println("Dont show this [" + i + "]" +
menus[i]);

           }

        

          PermissionsAdapter permissions = new
CustomePermissionsAdapter(menus);

          request.setAttribute("permissionAdapter", permissions);

 

But in the isAllowed method only 2 menus are fired up the 2 first , the
menu looks like this

 

File 

==>     A

*       B

*       C

*       D

 

Only File and A are fired in isAllowd method so  I can't filter B,C or D

 

Best Regrds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.