### Question:
DefaultAclManager implements AclManager { @Override public Acl getPermissions( final Page page ) { Acl acl = page.getAcl(); log.debug( "page=" + page.getName() + "\n" + acl ); if( acl == null ) { if( page instanceof Attachment ) { final Page parent = m_engine.getManager( PageManager.class ).getPage( ( ( Attachment ) page ).getParentName() ); acl = getPermissions(parent); } else { final Context ctx = Wiki.context().create( m_engine, page ); ctx.setVariable( Context.VAR_EXECUTE_PLUGINS, Boolean.FALSE ); m_engine.getManager( RenderingManager.class ).getHTML(ctx, page); if (page.getAcl() == null) { page.setAcl( Wiki.acls().acl() ); } acl = page.getAcl(); } } return acl; }  @Override void initialize( final Engine engine, final Properties props ); @Override Acl parseAcl( final Page page, final String ruleLine ); @Override Acl getPermissions( final Page page ); @Override void setPermissions( final Page page, final Acl acl ); static final Pattern ACL_PATTERN; }### Answer:
@Test public void testGetPermissions() { Page page = m_engine.getManager( PageManager.class ).getPage( "TestDefaultPage" ); Acl acl = m_engine.getManager( AclManager.class ).getPermissions( page ); Assertions.assertNotNull( page.getAcl() ); Assertions.assertTrue(page.getAcl().isEmpty()); page = m_engine.getManager( PageManager.class ).getPage( "TestAclPage" ); acl = m_engine.getManager( AclManager.class ).getPermissions( page ); Assertions.assertNotNull( page.getAcl() ); Assertions.assertFalse(page.getAcl().isEmpty()); Principal[] p; p = acl.findPrincipals( PermissionFactory.getPagePermission(page, "view") ); Assertions.assertEquals( 2, p.length ); Assertions.assertTrue( ArrayUtils.contains( p, new WikiPrincipal("Charlie") ) ); p = acl.findPrincipals( PermissionFactory.getPagePermission(page, "edit") ); Assertions.assertEquals( 2, p.length ); Assertions.assertTrue( ArrayUtils.contains( p, new WikiPrincipal("Charlie") ) ); p = acl.findPrincipals( PermissionFactory.getPagePermission(page, "delete") ); Assertions.assertEquals( 0, p.length ); p = acl.findPrincipals( PermissionFactory.getPagePermission(page, "view") ); Assertions.assertEquals( 2, p.length ); Assertions.assertTrue( ArrayUtils.contains( p, new UnresolvedPrincipal("Herman") ) ); p = acl.findPrincipals( PermissionFactory.getPagePermission(page, "edit") ); Assertions.assertEquals( 2, p.length ); Assertions.assertTrue( ArrayUtils.contains( p, new UnresolvedPrincipal("Herman") ) ); p = acl.findPrincipals( PermissionFactory.getPagePermission(page, "delete") ); Assertions.assertEquals( 0, p.length ); }