1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.view;
17
18 import java.io.Serializable;
19 import java.util.HashMap;
20 import java.util.Map;
21
22
23
24
25
26
27 public class RequestAuthorizationCache implements Serializable {
28 private static final long serialVersionUID = 4773874972787299349L;
29
30 private Map<String, Boolean> permissionResultCache;
31
32 public RequestAuthorizationCache() {
33 permissionResultCache = new HashMap<String, Boolean>();
34 }
35
36
37
38
39
40
41 public Map<String, Boolean> getPermissionResultCache() {
42 return permissionResultCache;
43 }
44
45 public boolean hasPermissionResult(String resultKey) {
46 return permissionResultCache.containsKey(resultKey);
47 }
48
49 public Boolean getPermissionResult(String resultKey) {
50 Boolean result = null;
51
52 if (hasPermissionResult(resultKey)) {
53 result = Boolean.valueOf(permissionResultCache.get(resultKey));
54 }
55
56 return result;
57 }
58
59 public void addPermissionResult(String resultKey, boolean result) {
60 permissionResultCache.put(resultKey, Boolean.valueOf(result));
61 }
62 }