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.sec.SecKeyConstants;
22 import org.kuali.ole.sec.service.AccessSecurityService;
23 import org.kuali.ole.sec.util.SecUtil;
24 import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
25 import org.kuali.rice.krad.util.GlobalVariables;
26
27
28
29
30
31 public class AccessSecurityLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl {
32 protected AccessSecurityService accessSecurityService;
33
34
35
36
37
38
39 public List getSearchResults(Map<String, String> fieldValues) {
40 List results = super.getSearchResults(fieldValues);
41
42 int resultSizeBeforeRestrictions = results.size();
43 accessSecurityService.applySecurityRestrictionsForLookup(results, GlobalVariables.getUserSession().getPerson());
44
45 accessSecurityService.compareListSizeAndAddMessageIfChanged(resultSizeBeforeRestrictions, results, SecKeyConstants.MESSAGE_LOOKUP_RESULTS_RESTRICTED);
46
47 return results;
48 }
49
50
51
52
53
54
55 public List getSearchResultsUnbounded(Map<String, String> fieldValues) {
56 List results = super.getSearchResultsUnbounded(fieldValues);
57
58 int resultSizeBeforeRestrictions = results.size();
59 accessSecurityService.applySecurityRestrictionsForLookup(results, GlobalVariables.getUserSession().getPerson());
60
61 accessSecurityService.compareListSizeAndAddMessageIfChanged(resultSizeBeforeRestrictions, results, SecKeyConstants.MESSAGE_LOOKUP_RESULTS_RESTRICTED);
62
63 return results;
64 }
65
66
67
68
69
70
71 public void setAccessSecurityService(AccessSecurityService accessSecurityService) {
72 this.accessSecurityService = accessSecurityService;
73 }
74
75 }