@Test public void testHasReadAccessWithNoReadAccess() { ParseACL acl = mock(ParseACL.class); when(acl.getPublicReadAccess()).thenReturn(false); when(acl.getReadAccess(any(ParseUser.class))).thenReturn(false); ParseObject object = mock(ParseObject.class); when(object.getACL()).thenReturn(acl); assertFalse(OfflineQueryLogic.hasReadAccess(null, object)); }
static <T extends ParseObject> boolean hasReadAccess(ParseUser user, T object) { if (user == object) { return true; } ParseACL acl = object.getACL(); if (acl == null) { return true; } if (acl.getPublicReadAccess()) { return true; } return user != null && acl.getReadAccess(user); }
OfflineQueryLogic { static <T extends ParseObject> boolean hasReadAccess(ParseUser user, T object) { if (user == object) { return true; } ParseACL acl = object.getACL(); if (acl == null) { return true; } if (acl.getPublicReadAccess()) { return true; } return user != null && acl.getReadAccess(user); } }
OfflineQueryLogic { static <T extends ParseObject> boolean hasReadAccess(ParseUser user, T object) { if (user == object) { return true; } ParseACL acl = object.getACL(); if (acl == null) { return true; } if (acl.getPublicReadAccess()) { return true; } return user != null && acl.getReadAccess(user); } OfflineQueryLogic(OfflineStore store); }
OfflineQueryLogic { static <T extends ParseObject> boolean hasReadAccess(ParseUser user, T object) { if (user == object) { return true; } ParseACL acl = object.getACL(); if (acl == null) { return true; } if (acl.getPublicReadAccess()) { return true; } return user != null && acl.getReadAccess(user); } OfflineQueryLogic(OfflineStore store);  }
OfflineQueryLogic { static <T extends ParseObject> boolean hasReadAccess(ParseUser user, T object) { if (user == object) { return true; } ParseACL acl = object.getACL(); if (acl == null) { return true; } if (acl.getPublicReadAccess()) { return true; } return user != null && acl.getReadAccess(user); } OfflineQueryLogic(OfflineStore store);   }