@Test void hasRightShouldReturnTrueWhenTheUserDoesNotOwnTheMailboxButHaveTheCorrectRightOnIt() throws MailboxException { Mailbox mailbox = new Mailbox(MailboxPath.forUser(BOB, MailboxConstants.INBOX), UID_VALIDITY, MAILBOX_ID); mailbox.setACL(new MailboxACL(new MailboxACL.Entry(MailboxFixture.ALICE.asString(), Right.Write))); assertThat(storeRightManager.hasRight(mailbox, Right.Write, aliceSession)) .isTrue(); }
@Override public boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session) throws MailboxException { return myRights(mailboxPath, session).contains(right); }
StoreRightManager implements RightManager { @Override public boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session) throws MailboxException { return myRights(mailboxPath, session).contains(right); } }
StoreRightManager implements RightManager { @Override public boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session) throws MailboxException { return myRights(mailboxPath, session).contains(right); } @Inject  StoreRightManager(MailboxSessionMapperFactory mailboxSessionMapperFactory,
                             MailboxACLResolver aclResolver,
                             GroupMembershipResolver groupMembershipResolver,
                             EventBus eventBus); }
StoreRightManager implements RightManager { @Override public boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session) throws MailboxException { return myRights(mailboxPath, session).contains(right); } @Inject  StoreRightManager(MailboxSessionMapperFactory mailboxSessionMapperFactory,
                             MailboxACLResolver aclResolver,
                             GroupMembershipResolver groupMembershipResolver,
                             EventBus eventBus); @Override boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session); @Override boolean hasRight(MailboxId mailboxId, Right right, MailboxSession session); boolean hasRight(Mailbox mailbox, Right right, MailboxSession session); @Override Rfc4314Rights myRights(MailboxPath mailboxPath, MailboxSession session); @Override Mono<Rfc4314Rights> myRights(MailboxId mailboxId, MailboxSession session); @Override Rfc4314Rights myRights(Mailbox mailbox, MailboxSession session); @Override List<Rfc4314Rights> listRights(MailboxPath mailboxPath, EntryKey key, MailboxSession session); @Override MailboxACL listRights(MailboxPath mailboxPath, MailboxSession session); @Override void applyRightsCommand(MailboxPath mailboxPath, ACLCommand mailboxACLCommand, MailboxSession session); @Override void applyRightsCommand(MailboxId mailboxId, ACLCommand mailboxACLCommand, MailboxSession session); boolean isReadWrite(MailboxSession session, Mailbox mailbox, Flags sharedPermanentFlags); @Override void setRights(MailboxId mailboxId, MailboxACL mailboxACL, MailboxSession session); @Override void setRights(MailboxPath mailboxPath, MailboxACL mailboxACL, MailboxSession session); MailboxACL getResolvedMailboxACL(Mailbox mailbox, MailboxSession mailboxSession); }
StoreRightManager implements RightManager { @Override public boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session) throws MailboxException { return myRights(mailboxPath, session).contains(right); } @Inject  StoreRightManager(MailboxSessionMapperFactory mailboxSessionMapperFactory,
                             MailboxACLResolver aclResolver,
                             GroupMembershipResolver groupMembershipResolver,
                             EventBus eventBus); @Override boolean hasRight(MailboxPath mailboxPath, Right right, MailboxSession session); @Override boolean hasRight(MailboxId mailboxId, Right right, MailboxSession session); boolean hasRight(Mailbox mailbox, Right right, MailboxSession session); @Override Rfc4314Rights myRights(MailboxPath mailboxPath, MailboxSession session); @Override Mono<Rfc4314Rights> myRights(MailboxId mailboxId, MailboxSession session); @Override Rfc4314Rights myRights(Mailbox mailbox, MailboxSession session); @Override List<Rfc4314Rights> listRights(MailboxPath mailboxPath, EntryKey key, MailboxSession session); @Override MailboxACL listRights(MailboxPath mailboxPath, MailboxSession session); @Override void applyRightsCommand(MailboxPath mailboxPath, ACLCommand mailboxACLCommand, MailboxSession session); @Override void applyRightsCommand(MailboxId mailboxId, ACLCommand mailboxACLCommand, MailboxSession session); boolean isReadWrite(MailboxSession session, Mailbox mailbox, Flags sharedPermanentFlags); @Override void setRights(MailboxId mailboxId, MailboxACL mailboxACL, MailboxSession session); @Override void setRights(MailboxPath mailboxPath, MailboxACL mailboxACL, MailboxSession session); MailboxACL getResolvedMailboxACL(Mailbox mailbox, MailboxSession mailboxSession); static final boolean GROUP_FOLDER; }