@Test public void testCheckParticipantTypesWhenPrincipalIsNotInAnyOfRequiredTypes() { List<String> userIsParticipantTypeAny = Arrays.asList("assignee", "supervisor", "owning group"); AccessControlRule accessControlRule = getAccessControlRuleForParticipantTypesTest(); accessControlRule.setUserIsParticipantTypeAny(userIsParticipantTypeAny); Collection grantedAuthorities = getGrantedAuthoritiesMockList(); mockExpectsWhenParticipantTypesTest(accessControlRule, grantedAuthorities); JSONObject solrDocumentJson = new JSONObject(solrDocument); JSONObject solrResultJson = solrDocumentJson.getJSONObject("response").getJSONArray("docs").getJSONObject(0); solrResultJson.put("acm_participants_lcs", "[{\"ldapId\":\"ACM_INVESTIGATOR_DEV\", \"type\":\"owning group\"}," + "{\"ldapId\":\"ian-acm\", \"type\":\"assignee\"}]"); boolean granted = accessControlRuleChecker.isAccessGranted(authenticationMock, 1L, "CASE_FILE", "restrictCase", solrDocumentJson.toString()); assertFalse(granted); verifyAll(); }
@Override public boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument) { return isAccessGranted(authentication, targetId, targetType, Arrays.asList(permission.split("\\|")), solrDocument); }
AccessControlRuleCheckerImpl implements AccessControlRuleChecker { @Override public boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument) { return isAccessGranted(authentication, targetId, targetType, Arrays.asList(permission.split("\\|")), solrDocument); } }
AccessControlRuleCheckerImpl implements AccessControlRuleChecker { @Override public boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument) { return isAccessGranted(authentication, targetId, targetType, Arrays.asList(permission.split("\\|")), solrDocument); }  }
AccessControlRuleCheckerImpl implements AccessControlRuleChecker { @Override public boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument) { return isAccessGranted(authentication, targetId, targetType, Arrays.asList(permission.split("\\|")), solrDocument); }  void postConstruct(); @Override boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument); @Override AccessControlRules getAccessControlRules(); @Override void setAccessControlRules(AccessControlRules accessControlRules); File getConfigurationFile(); void setConfigurationFile(File configurationFile); ObjectConverter getObjectConverter(); void setObjectConverter(ObjectConverter objectConverter); DataAccessControlConfig getDacConfig(); void setDacConfig(DataAccessControlConfig dacConfig); }
AccessControlRuleCheckerImpl implements AccessControlRuleChecker { @Override public boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument) { return isAccessGranted(authentication, targetId, targetType, Arrays.asList(permission.split("\\|")), solrDocument); }  void postConstruct(); @Override boolean isAccessGranted(Authentication authentication, Long targetId, String targetType, String permission, String solrDocument); @Override AccessControlRules getAccessControlRules(); @Override void setAccessControlRules(AccessControlRules accessControlRules); File getConfigurationFile(); void setConfigurationFile(File configurationFile); ObjectConverter getObjectConverter(); void setObjectConverter(ObjectConverter objectConverter); DataAccessControlConfig getDacConfig(); void setDacConfig(DataAccessControlConfig dacConfig);  }