Package org.apache.james.mailbox.model.MailboxACL

Examples of org.apache.james.mailbox.model.MailboxACL.MailboxACLRights


        final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
        final String mailboxName = message.getMailboxName();
        try {

            MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession);
            MailboxACLRights myRights = messageManager.myRights(mailboxSession);

            /*
             * RFC 4314 section 6. An implementation MUST make sure the ACL
             * commands themselves do not give information about mailboxes with
             * appropriately restricted ACLs. For example, when a user agent
             * executes a GETACL command on a mailbox that the user has no
             * permission to LIST, the server would respond to that request with
             * the same error that would be used if the mailbox did not exist,
             * thus revealing no existence information, much less the mailbox’s
             * ACL.
             *
             * RFC 4314 section 4. * MYRIGHTS - any of the following rights is
             * required to perform the operation: "l", "r", "i", "k", "x", "a".
             */
            if (!myRights.contains(Rfc4314Rights.l_Lookup_RIGHT)
                    && !myRights.contains(Rfc4314Rights.r_Read_RIGHT)
                    && !myRights.contains(Rfc4314Rights.i_Insert_RIGHT)
                    && !myRights.contains(Rfc4314Rights.k_CreateMailbox_RIGHT)
                    && !myRights.contains(Rfc4314Rights.x_DeleteMailbox_RIGHT)
                    && !myRights.contains(Rfc4314Rights.a_Administer_RIGHT)) {
                no(command, tag, responder, HumanReadableText.MAILBOX_NOT_FOUND);
            } else {
                MyRightsResponse myRightsResponse = new MyRightsResponse(mailboxName, myRights);
                responder.respond(myRightsResponse);
                okComplete(command, tag, responder);
View Full Code Here


     * org.apache.james.imap.encode.ImapResponseComposer,
     * org.apache.james.imap.api.process.ImapSession)
     */
    protected void doEncode(ImapMessage acceptableMessage, ImapResponseComposer composer, ImapSession session) throws IOException {
        final MyRightsResponse aclResponse = (MyRightsResponse) acceptableMessage;
        final MailboxACLRights myRights = aclResponse.getMyRights();
        composer.untagged();
        composer.commandName(ImapConstants.MYRIGHTS_RESPONSE_NAME);
       
        String mailboxName = aclResponse.getMailboxName();
        composer.mailbox(mailboxName == null ? "" : mailboxName);
        composer.quote(myRights == null ? "" : myRights.serialize());
        composer.end();
    }
View Full Code Here

                    editMode = MailboxACL.EditMode.REMOVE;
                    rights = rights.substring(1);
                    break;
                }
            }
            MailboxACLRights mailboxAclRights = new Rfc4314Rights(rights);

            MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession);

            /*
             * RFC 4314 section 6.
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.model.MailboxACL.MailboxACLRights

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.