Package org.apache.james.imapserver

Examples of org.apache.james.imapserver.AuthorizationException



    public InternetHeaders getInternetHeaders(int msn, String user)
        throws AccessControlException, AuthorizationException {
        if (!hasReadRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to read.");
        }
        if (msn > sequence.size()) {
            return null;
        } else {
            int uid = ((Integer)sequence.get(msn - 1)).intValue();
View Full Code Here


            // Does user have create rights in parent mailbox?
            boolean hasCreateRights = parentMailbox.hasCreateRights( user );
            releaseMailbox( user, parentMailbox );
            if ( ! hasCreateRights ) {
                releaseMailbox( user, parentMailbox );
                throw new AuthorizationException( "User does not have create rights." );
            }
            try {
                //TODO: BUG! Here MUST be used a Factory for using FILE / JDBC !!!
                mailbox = new FileMailbox();
                setupLogger( mailbox );
View Full Code Here

            throw new MailboxException( "Mailbox is currently selected by another user" );
        }

        ACLMailbox mailbox = getAbsoluteMailbox( user, absoluteName );
        if ( ! mailbox.hasDeleteRights( user ) ) {
            throw new AuthorizationException( "No delete rights" );
        }

        // Get child folders of this mailbox
        Collection childList = listMailboxes( MailServer.MDA, absoluteName, "%", false );
        if ( ! childList.isEmpty() ) {
View Full Code Here

                }
            }
            return false;
        } catch (Exception e) {
            e.printStackTrace();
            throw new AuthorizationException("You have insufficient permission to change the Mailbox Name");
        }
    }
View Full Code Here

            // Does user have create rights in parent mailbox?
            boolean hasCreateRights = parentMailbox.hasCreateRights( user );
            releaseMailbox( user, parentMailbox );
            if ( ! hasCreateRights ) {
                releaseMailbox( user, parentMailbox );
                throw new AuthorizationException( "User does not have create rights." );
            }
            try {
                //TODO: BUG! Here MUST be used a Factory for using FILE / JDBC !!!
                mailbox = new FileMailbox();
                setupLogger( mailbox );
View Full Code Here

            throw new MailboxException( "Mailbox is currently selected by another user" );
        }

        ACLMailbox mailbox = getAbsoluteMailbox( user, absoluteName );
        if ( ! mailbox.hasDeleteRights( user ) ) {
            throw new AuthorizationException( "No delete rights" );
        }

        // Get child folders of this mailbox
        Collection childList = listMailboxes( MailServer.MDA, absoluteName, "%", false );
        if ( ! childList.isEmpty() ) {
View Full Code Here

                }
            }
            return false;
        } catch (Exception e) {
            e.printStackTrace();
            throw new AuthorizationException("You have insufficient permission to change the Mailbox Name");
        }
    }
View Full Code Here

        boolean[] settersRights = (boolean[]) acl.get(setter);
        if (settersRights == null
            || (settersRights[LOOKUP] == false)) {
            throw new AccessControlException(DENY_ACCESS);
        } else if (settersRights[ADMIN] == false) {
            throw new AuthorizationException(DENY_AUTH + setter);
        }
        boolean[] existingRights = (boolean[]) acl.get(identifier);
        char[] mods = modification.toCharArray();
        if (mods.length == 0) { // means delete all
            mods = DELETE_MODS;
View Full Code Here

        boolean[] gettersRights = (boolean[])  acl.get(getter);
        if (gettersRights == null
            || (gettersRights[LOOKUP] == false)) {
            throw new AccessControlException(DENY_ACCESS);
        } else if (!getter.equals(identity) && gettersRights[ADMIN] == false) {
            throw new AuthorizationException(DENY_AUTH + getter);
        }
        boolean[] rights = (boolean[]) acl.get(identity);
        if (rights == null) {
            return null;
        } else {
View Full Code Here

        boolean[] gettersRights = (boolean[]) acl.get(getter);
        if (gettersRights == null
            || (gettersRights[LOOKUP] == false)) {
            throw new AccessControlException(DENY_ACCESS);
        } else if ( gettersRights[ADMIN] == false) {
            throw new AuthorizationException(DENY_AUTH + getter);
        }
        Iterator namesIt = acl.keySet().iterator();
        StringBuffer response = new StringBuffer(20*acl.size());
        while(namesIt.hasNext()) {
            String name = (String)namesIt.next();
View Full Code Here

TOP

Related Classes of org.apache.james.imapserver.AuthorizationException

Copyright © 2018 www.massapicom. 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.