1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.api.block;
17
18
19
20 import java.io.Serializable;
21 import java.util.HashMap;
22 import java.util.Map;
23
24 import org.kuali.kpme.core.api.util.HrApiConstants;
25
26 public class CalendarBlockPermissions implements Serializable {
27 public static final String CACHE_NAME = HrApiConstants.CacheNamespace.NAMESPACE_PREFIX + "CalendarBlockPermission";
28
29 private String blockId;
30 private Map<String, Boolean> canEdit = new HashMap<String, Boolean>();
31 private Map<String, Boolean> canEditAllFields = new HashMap<String, Boolean>();
32 private Map<String, Boolean> canDelete = new HashMap<String, Boolean>();
33 private Map<String, Boolean> canEditOvertimeEarnCode = new HashMap<String, Boolean>();
34
35 public static CalendarBlockPermissions newInstance(String timeBlockId) {
36 return new CalendarBlockPermissions(timeBlockId);
37 }
38
39 public CalendarBlockPermissions(String blockId) {
40 this.blockId = blockId;
41 }
42
43 public String getBlockId() {
44 return blockId;
45 }
46
47 public void setBlockId(String blockId) {
48 this.blockId = blockId;
49 }
50
51 public Map<String, Boolean> getCanEdit() {
52 return canEdit;
53 }
54
55 public Boolean isPrincipalCanEdit(String principalId) {
56 return getCanEdit().get(principalId);
57 }
58
59 public void setCanEdit(Map<String, Boolean> canEdit) {
60 this.canEdit = canEdit;
61 }
62
63 public void putCanEdit(String principalId, Boolean edit) {
64 this.canEdit.put(principalId, edit);
65 }
66
67 public Map<String, Boolean> getCanEditAllFields() {
68 return canEditAllFields;
69 }
70
71 public Boolean isPrincipalCanEditAllFields(String principalId) {
72 return getCanEditAllFields().get(principalId);
73 }
74
75 public void setCanEditAllFields(Map<String, Boolean> canEditAllFields) {
76 this.canEditAllFields = canEditAllFields;
77 }
78
79 public void putCanEditAllFields(String principalId, Boolean editAll) {
80 this.canEditAllFields.put(principalId, editAll);
81 }
82
83 public Map<String, Boolean> getCanDelete() {
84 return canDelete;
85 }
86
87 public Boolean isPrincipalCanDelete(String principalId) {
88 return getCanDelete().get(principalId);
89 }
90
91 public void setCanDelete(Map<String, Boolean> canDelete) {
92 this.canDelete = canDelete;
93 }
94
95 public void putCanDelete(String principalId, Boolean delete) {
96 this.canDelete.put(principalId, delete);
97 }
98
99
100 public Map<String, Boolean> getCanEditOvertimeEarnCode() {
101 return canEditOvertimeEarnCode;
102 }
103
104 public Boolean isPrincipalCanEditOvertimeEarnCode(String principalId) {
105 return getCanEditOvertimeEarnCode().get(principalId);
106 }
107
108 public void setCanEditOvertimeEarnCode(Map<String, Boolean> canEdit) {
109 this.canEditOvertimeEarnCode = canEdit;
110 }
111
112 public void putCanEditOvertimeEarnCode(String principalId, Boolean edit) {
113 this.canEditOvertimeEarnCode.put(principalId, edit);
114 }
115
116
117
118
119
120
121
122
123 }