You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Lo...@log-net.com on 2011/07/13 18:54:49 UTC

Code to filter pages by ACL

OK, I'm being a bit lazy, but can anyone point me to some code that, given 
a list of all pages in a wiki, using ACLs, will filter out pages that the 
user can not see (does not have view permission).  Basically, I don't even 
want them to see the names in my list.

So far I have:

for( Iterator i = pages.iterator(); i.hasNext(); )
{
        WikiPage wp = ((WikiPage) i.next());
        Acl pageACL = aclManager.getPermissions(wp);
        if(pageACL!=null && !pageACL.isEmpty()) {
                if(?????) {
                        show page here
                }
        }
}

Thanks,
Lou