// Try to add the entry. If this fails with the proxy control, then add it
// with a root connection so we can do other things with it.
DN authDN = conn.getAuthenticationInfo().getAuthenticationDN();
AddOperationBasis addOperation =
new AddOperationBasis(conn, conn
.nextOperationID(), conn.nextMessageID(), controls, e.getDN(), e
.getObjectClasses(), e.getUserAttributes(), e
.getOperationalAttributes());
addOperation.run();
if (hasProxyPrivilege)
{
assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS,
"Unexpected add failure for user " + authDN);
}
else
{
assertEquals(addOperation.getResultCode(),
ResultCode.AUTHORIZATION_DENIED,
"Unexpected add success for user " + authDN);
TestCaseUtils.addEntry(e);
}