1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sec.service.impl;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.ole.integration.cg.ContractsAndGrantsModuleService;
20 import org.kuali.ole.sys.OLEPropertyConstants;
21 import org.kuali.ole.sys.context.SpringContext;
22 import org.kuali.rice.kim.api.identity.Person;
23
24
25
26
27 public class PrincipalInvestigatorAccessPermissionEvaluatorImpl extends AccessPermissionEvaluatorImpl {
28
29
30
31
32
33
34 @Override
35 protected boolean isMatch(String matchValue, String value) {
36 boolean match = false;
37
38 String chartCode = (String) otherKeyFieldValues.get(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE);
39
40 Person principalInvestigator = SpringContext.getBean(ContractsAndGrantsModuleService.class).getProjectDirectorForAccount(chartCode, value);
41 if (StringUtils.equals(person.getPrincipalId(), principalInvestigator.getPrincipalId())) {
42 match = true;
43 }
44
45 return match;
46 }
47
48 }