@Test public void testHasReadAccessWithSameObject() { ParseUser user = mock(ParseUser.class); assertTrue(OfflineQueryLogic.hasReadAccess(user, user)); verify(user, never()).getACL(); }
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);   }