@Test public void delegatedUserShouldHaveMayAddItemsWhenAllowedToInsert() throws Exception { MailboxPath inbox = MailboxPath.inbox(user); Optional<MailboxId> mailboxId = mailboxManager.createMailbox(inbox, mailboxSession); mailboxManager.applyRightsCommand(inbox, MailboxACL.command() .forUser(otherUser) .rights(MailboxACL.Right.Insert, MailboxACL.Right.Lookup) .asAddition(), mailboxSession); Mailbox retrievedMailbox = sut.builder() .id(mailboxId.get()) .session(otherMailboxSession) .build() .get(); softly.assertThat(retrievedMailbox.isMayAddItems()).isTrue(); softly.assertThat(retrievedMailbox.isMayCreateChild()).isFalse(); softly.assertThat(retrievedMailbox.isMayDelete()).isFalse(); softly.assertThat(retrievedMailbox.isMayReadItems()).isFalse(); softly.assertThat(retrievedMailbox.isMayRemoveItems()).isFalse(); softly.assertThat(retrievedMailbox.isMayRename()).isFalse(); }
public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } @Inject  MailboxFactory(MailboxManager mailboxManager, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver); }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } @Inject  MailboxFactory(MailboxManager mailboxManager, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver); MailboxBuilder builder(); }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } @Inject  MailboxFactory(MailboxManager mailboxManager, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver); MailboxBuilder builder();  }