LdapDN userName = principal.getJndiName();
LdapDN principalDn = principal.getJndiName();
    public void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException    {        // Access the principal requesting the operation, and bypass checks if it is the admin        Invocation invocation = InvocationStack.getInstance().peek();        PartitionNexusProxy proxy = invocation.getProxy();        Attributes entry = proxy.lookup( name, PartitionNexusProxy.LOOKUP_BYPASS );        LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();        LdapDN userName = principal.getJndiName();        LdapDN newName = ( LdapDN ) name.clone();        newName.remove( name.size() - 1 );        newName.add( parseNormalized( newRn ).get( 0 ) );        // bypass authz code if we are disabled        if ( !enabled )        {            next.modifyRn( name, newRn, deleteOldRn );            return;        }        // bypass authz code but manage caches if operation is performed by the admin        if ( userName.toString().equalsIgnoreCase( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED ) )        {            next.modifyRn( name, newRn, deleteOldRn );            tupleCache.subentryRenamed( name, newName );            if ( groupCache.groupRenamed( name, newName ) )            {            }            return;        }        Set userGroups = groupCache.getGroups( userName.toString() );        Collection tuples = new HashSet();        addPerscriptiveAciTuples( proxy, tuples, name, entry );        addEntryAciTuples( tuples, entry );        addSubentryAciTuples( proxy, tuples, name, entry );        engine.checkPermission( proxy, userGroups, userName, principal.getAuthenticationLevel(), name, null, null,            RENAME_PERMS, tuples, entry );        //        if ( deleteOldRn )        //        {        //            String oldRn = name.get( name.size() - 1 );        //            if ( NamespaceTools.hasCompositeComponents( oldRn ) )        //            {        //                String[] comps = NamespaceTools.getCompositeComponents( oldRn );        //                for ( int ii = 0; ii < comps.length; ii++ )        //                {        //                    String id = NamespaceTools.getRdnAttribute( comps[ii] );        //                    String value = NamespaceTools.getRdnValue( comps[ii] );        //                    engine.checkPermission( next, userGroups, user.getJndiName(),        //                            user.getAuthenticationLevel(), name, id,        //                            value, Collections.singleton( MicroOperation.REMOVE ),        //                            tuples, entry );        //                }        //            }        //            else        //            {        //                String id = NamespaceTools.getRdnAttribute( oldRn );        //                String value = NamespaceTools.getRdnValue( oldRn );        //                engine.checkPermission( next, userGroups, user.getJndiName(),        //                        user.getAuthenticationLevel(), name, id,        //                        value, Collections.singleton( MicroOperation.REMOVE ),        //                        tuples, entry );        //            }        //        }        next.modifyRn( name, newRn, deleteOldRn );        tupleCache.subentryRenamed( name, newName );        groupCache.groupRenamed( name, newName );    }