@Test public void testHasPrivileges() throws Exception { JackrabbitAccessControlManager delegate = mock(JackrabbitAccessControlManager.class); JackrabbitAccessControlManagerFacade facade = getFacade(delegate); final Set<Principal> principals = Collections.singleton(EveryonePrincipal.getInstance()); final Privilege[] privileges = new Privilege[0]; when(delegate.hasPrivileges("/foo", principals, privileges)).thenReturn(true); assertFalse("should not hasPrivileges", facade.hasPrivileges("", principals, privileges)); assertTrue("should hasPrivileges", facade.hasPrivileges("/foo", principals, privileges)); }
@Override public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws RepositoryException { return delegate.hasPrivileges(absPath, principals, privileges); }
JackrabbitAccessControlManagerFacade extends AccessControlManagerFacade<JackrabbitAccessControlManager> implements JackrabbitAccessControlManager { @Override public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws RepositoryException { return delegate.hasPrivileges(absPath, principals, privileges); } }
JackrabbitAccessControlManagerFacade extends AccessControlManagerFacade<JackrabbitAccessControlManager> implements JackrabbitAccessControlManager { @Override public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws RepositoryException { return delegate.hasPrivileges(absPath, principals, privileges); } @SuppressWarnings("WeakerAccess")  JackrabbitAccessControlManagerFacade(final @NotNull JackrabbitAccessControlManager delegate); }
JackrabbitAccessControlManagerFacade extends AccessControlManagerFacade<JackrabbitAccessControlManager> implements JackrabbitAccessControlManager { @Override public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws RepositoryException { return delegate.hasPrivileges(absPath, principals, privileges); } @SuppressWarnings("WeakerAccess")  JackrabbitAccessControlManagerFacade(final @NotNull JackrabbitAccessControlManager delegate); @Override JackrabbitAccessControlPolicy[] getApplicablePolicies(Principal principal); @Override JackrabbitAccessControlPolicy[] getPolicies(Principal principal); @Override AccessControlPolicy[] getEffectivePolicies(Set<Principal> principals); @Override boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges); @Override Privilege[] getPrivileges(String absPath, Set<Principal> principals); }
JackrabbitAccessControlManagerFacade extends AccessControlManagerFacade<JackrabbitAccessControlManager> implements JackrabbitAccessControlManager { @Override public boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges) throws RepositoryException { return delegate.hasPrivileges(absPath, principals, privileges); } @SuppressWarnings("WeakerAccess")  JackrabbitAccessControlManagerFacade(final @NotNull JackrabbitAccessControlManager delegate); @Override JackrabbitAccessControlPolicy[] getApplicablePolicies(Principal principal); @Override JackrabbitAccessControlPolicy[] getPolicies(Principal principal); @Override AccessControlPolicy[] getEffectivePolicies(Set<Principal> principals); @Override boolean hasPrivileges(String absPath, Set<Principal> principals, Privilege[] privileges); @Override Privilege[] getPrivileges(String absPath, Set<Principal> principals);  }