1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sec.businessobject.lookup;
17
18 import java.util.List;
19 import java.util.Map;
20
21 import org.kuali.ole.coa.businessobject.lookup.OrganizationRoutingModelNameLookupableHelperServiceImpl;
22 import org.kuali.ole.sec.SecKeyConstants;
23 import org.kuali.ole.sec.service.AccessSecurityService;
24 import org.kuali.ole.sec.util.SecUtil;
25 import org.kuali.rice.krad.util.GlobalVariables;
26
27 public class AccessSecurityAccountDelegateModelLookupableHelperServiceImpl extends OrganizationRoutingModelNameLookupableHelperServiceImpl {
28
29 protected AccessSecurityService accessSecurityService;
30
31
32
33
34
35
36 public List getSearchResults(Map<String, String> fieldValues) {
37 List results = super.getSearchResults(fieldValues);
38
39 int resultSizeBeforeRestrictions = results.size();
40 accessSecurityService.applySecurityRestrictionsForLookup(results, GlobalVariables.getUserSession().getPerson());
41
42 accessSecurityService.compareListSizeAndAddMessageIfChanged(resultSizeBeforeRestrictions, results, SecKeyConstants.MESSAGE_LOOKUP_RESULTS_RESTRICTED);
43
44 return results;
45 }
46
47
48
49
50
51
52 public List getSearchResultsUnbounded(Map<String, String> fieldValues) {
53 List results = super.getSearchResultsUnbounded(fieldValues);
54
55 int resultSizeBeforeRestrictions = results.size();
56 accessSecurityService.applySecurityRestrictionsForLookup(results, GlobalVariables.getUserSession().getPerson());
57
58 accessSecurityService.compareListSizeAndAddMessageIfChanged(resultSizeBeforeRestrictions, results, SecKeyConstants.MESSAGE_LOOKUP_RESULTS_RESTRICTED);
59
60 return results;
61 }
62
63
64
65
66
67
68 public void setAccessSecurityService(AccessSecurityService accessSecurityService) {
69 this.accessSecurityService = accessSecurityService;
70 }
71
72 }