Examples of LdapNoPermissionException


Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );

        InitialContext initCtx = new InitialContext( env );
        assertNotNull( initCtx );
        DirContext ctx = ( DirContext ) initCtx.lookup( "" );
        LdapNoPermissionException notNull = null;

        try
        {
            ctx.destroySubcontext( "" );
            fail( "we should never get here" );
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );

        InitialContext initCtx = new InitialContext( env );
        assertNotNull( initCtx );
        DirContext ctx = ( DirContext ) initCtx.lookup( "" );
        LdapNoPermissionException notNull = null;

        try
        {
            ctx.rename( "", "ou=system" );
            fail( "we should never get here" );
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );

        InitialContext initCtx = new InitialContext( env );
        assertNotNull( initCtx );
        DirContext ctx = ( DirContext ) initCtx.lookup( "" );
        LdapNoPermissionException notNull = null;

        try
        {
            ctx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, null );
            fail( "we should never get here" );
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        assertNotNull( initCtx );

        DirContext ctx = ( DirContext ) initCtx.lookup( "" );

        LdapNoPermissionException notNull = null;

        try
        {
            ctx.modifyAttributes( "", new ModificationItem[]
                {} );
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

    {
        if ( operation.getSession().isAnonymous() && !directoryService.isAllowAnonymousAccess()
            && !operation.getDn().isEmpty() )
        {
            LOG.error( I18n.err( I18n.ERR_5, operation.getName() ) );
            throw new LdapNoPermissionException( I18n.err( I18n.ERR_5, operation.getName() ) );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

     */
    private void moddn( DN oldDn, DN newDn, boolean delOldRdn ) throws Exception
    {
        if ( oldDn.size() == 0 )
        {
            throw new LdapNoPermissionException( I18n.err( I18n.ERR_312 ) );
        }

        // calculate parents
        DN oldBase = ( DN ) oldDn.clone();
        oldBase.remove( oldDn.size() - 1 );
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        {
            return LdapPrincipal.ANONYMOUS;
        }
        else
        {
            throw new LdapNoPermissionException( I18n.err( I18n.ERR_228 ) );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        ServerEntry entryView ) throws Exception
    {
        if ( !hasPermission( schemaManager, opContext, userGroupNames, username, authenticationLevel, entryName,
            attrId, attrValue, microOperations, aciTuples, entry, entryView ) )
        {
            throw new LdapNoPermissionException();
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        if ( dn.isEmpty() )
        {
            String msg = I18n.err( I18n.ERR_8 );
            LOG.error( msg );
            throw new LdapNoPermissionException( msg );
        }

        if ( isTheAdministrator( dn ) )
        {
            String msg = I18n.err( I18n.ERR_9, principalDn.getName(), dn.getName() );
            LOG.error( msg );
            throw new LdapNoPermissionException( msg );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.exception.LdapNoPermissionException

        if ( name.isEmpty() )
        {
            String msg = I18n.err( I18n.ERR_12 );
            LOG.error( msg );
            throw new LdapNoPermissionException( msg );
        }

        if ( name.getNormName().equals( ADMIN_GROUP_DN.getNormName() ) )
        {
            String msg = I18n.err( I18n.ERR_13 );
            LOG.error( msg );
            throw new LdapNoPermissionException( msg );
        }

        if ( isTheAdministrator( name ) )
        {
            String msg = I18n.err( I18n.ERR_14, principalDn.getName() );
            LOG.error( msg );
            throw new LdapNoPermissionException( msg );
        }

        if ( name.size() > 2 )
        {
            if ( !isAnAdministrator( principalDn ) )
            {
                if ( name.startsWith( USER_BASE_DN ) )
                {
                    String msg = I18n.err( I18n.ERR_15, principalDn.getName(), name.getName() );
                    LOG.error( msg );
                    throw new LdapNoPermissionException( msg );
                }
       
                if ( name.startsWith( GROUP_BASE_DN ) )
                {
                    String msg = I18n.err( I18n.ERR_16, principalDn.getName(), name.getName() );
                    LOG.error( msg );
                    throw new LdapNoPermissionException( msg );
                }
            }
        }

        nextInterceptor.delete( opContext );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.