UnionMailboxACLResolver implements MailboxACLResolver { @Override public Rfc4314Rights resolveRights(Username requestUser, GroupMembershipResolver groupMembershipResolver, MailboxACL resourceACL, String resourceOwner, boolean resourceOwnerIsGroup) throws UnsupportedRightException { Rfc4314Rights[] positiveNegativePair = { MailboxACL.NO_RIGHTS, MailboxACL.NO_RIGHTS }; final EntryKey queryKey = requestUser == null ? null : EntryKey.createUserEntryKey(requestUser); MailboxACL userACL = resourceOwnerIsGroup ? groupGlobalACL : userGlobalACL; resolveRights(queryKey, groupMembershipResolver, userACL.getEntries(), resourceOwner, resourceOwnerIsGroup, positiveNegativePair); if (resourceACL != null) { resolveRights(queryKey, groupMembershipResolver, resourceACL.getEntries(), resourceOwner, resourceOwnerIsGroup, positiveNegativePair); } return positiveNegativePair[POSITIVE_INDEX].except(positiveNegativePair[NEGATIVE_INDEX]); } UnionMailboxACLResolver();  UnionMailboxACLResolver(MailboxACL userGlobalACL, MailboxACL groupGlobalACL); @Override MailboxACL applyGlobalACL(MailboxACL resourceACL, boolean resourceOwnerIsGroup); @Override List<Rfc4314Rights> listRights(EntryKey queryKey, GroupMembershipResolver groupMembershipResolver, String resourceOwner, boolean resourceOwnerIsGroup); @Override Rfc4314Rights resolveRights(Username requestUser, GroupMembershipResolver groupMembershipResolver, MailboxACL resourceACL, String resourceOwner, boolean resourceOwnerIsGroup); static final MailboxACL DEFAULT_GLOBAL_GROUP_ACL; static final MailboxACL DEFAULT_GLOBAL_USER_ACL; }
@Test void testResolveRightsNullUser() throws UnsupportedRightException { assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); }
@Test void testResolveRightsNullUserGlobals() throws UnsupportedRightException { assertThat( anyoneReadListGlobal.resolveRights(null, groupMembershipResolver, user1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(null, groupMembershipResolver, MailboxACL.EMPTY, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(null, groupMembershipResolver, MailboxACL.EMPTY, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(null, groupMembershipResolver, MailboxACL.EMPTY, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(null, groupMembershipResolver, MailboxACL.EMPTY, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); }
@Test void testResolveRightsUserSelfOwner() throws UnsupportedRightException { assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_1.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); }
@Test void testResolveRightsUserNotOwner() throws UnsupportedRightException { assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, USER_2.asString(), false) .contains(MailboxACL.Right.Read)) .isFalse(); }
@Test void testResolveRightsUserMemberOfOwnerGroup() throws UnsupportedRightException { assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_1, true) .contains(MailboxACL.Right.Read)) .isFalse(); }
@Test void testResolveRightsUserNotMemberOfOwnerGroup() throws UnsupportedRightException { assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, user1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1Read, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, group1ReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, anybodyReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, authenticatedReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( anyoneReadListGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( authenticatedReadListWriteGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isTrue(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( ownerFullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( noGlobals.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerRead, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); assertThat( negativeGroup2FullGlobal.resolveRights(USER_1, groupMembershipResolver, ownerReadNegative, GROUP_2, true) .contains(MailboxACL.Right.Read)) .isFalse(); }