Package org.apache.james.imapserver

Examples of org.apache.james.imapserver.AuthorizationException


     * have delete rights.
     */
    public synchronized MessageAttributes getMessageAttributes(int msn, String user)
        throws AccessControlException, AuthorizationException {
        if (!hasReadRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to read.");
        }
        System.out.println("msn: "+msn);
        System.out.println("sequence.size: "+sequence.size());
        if (msn > sequence.size()) {
            return null;
View Full Code Here


     * have delete rights.
     */
    public synchronized MessageAttributes getMessageAttributesUID(int uid, String user)
        throws AccessControlException, AuthorizationException {
        if (!hasReadRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to read.");
        }
        System.out.println("getMessageAttributesUID()");
        System.out.println("uid: "+uid);
        System.out.println("user: "+user);
        System.out.println("sequence.size: "+sequence.size());
View Full Code Here

     * have delete rights.
     */
    public boolean updateMessageAttributes(MessageAttributes attrs, String user)
        throws AccessControlException, AuthorizationException {
        if (!hasKeepSeenRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to store flags.");
        }
        int uid = attrs.getUID();
        if (sequence.contains(new Integer(uid))) {

            // Really, we should check whether the exact change is authorized.
View Full Code Here

     * have read rights.
     */
    public synchronized  String getFlags(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

     * have read rights.
     */
    public synchronized  String getFlagsUID(int uid, String user)
        throws AccessControlException, AuthorizationException {
        if (!hasReadRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to read.");
        }
        java.util.Iterator it = sequence.iterator();
        while(it.hasNext())
            System.out.println("FILEMESSAGES...."+it.next().toString());
           
View Full Code Here

     */
    public synchronized  boolean setFlags(int msn, String user, String request)
        throws AccessControlException, AuthorizationException,
               IllegalArgumentException {
        if (!hasKeepSeenRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to store any flags.");
        }
        if (msn > sequence.size()) {
            return false;
        } else {
            int uid = ((Integer)sequence.get(msn - 1)).intValue();
View Full Code Here

     */
    public synchronized boolean setFlagsUID(int uid, String user, String request)
        throws AccessControlException, AuthorizationException,
               IllegalArgumentException {
        if (!hasKeepSeenRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to store any flags.");
        }
        if ((request.toUpperCase().indexOf("DELETED") != -1) && (!hasDeleteRights(user))) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to delete.");
        }
        if (sequence.contains(new Integer(uid))) {

            Flags flags = readFlags(uid);
            boolean wasRecent = flags.isRecent();
View Full Code Here

     * have delete rights.
     */
    public synchronized boolean expunge(String user)
        throws AccessControlException, AuthorizationException {
        if (!hasDeleteRights(user)) { //throws AccessControlException
            throw new AuthorizationException("Not authorized to delete for user '" + user + "'.");
        }
        Iterator it = messagesForDeletion.iterator();

        while (it.hasNext()) {
            Integer uidObj = (Integer)it.next();
View Full Code Here


    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

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.