1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.component;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase;
21
22 import java.io.Serializable;
23 import java.util.HashMap;
24 import java.util.Map;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 @BeanTag(name = "componentSecurity-bean")
41 public class ComponentSecurity extends UifDictionaryBeanBase implements Serializable {
42 private static final long serialVersionUID = 726347449984853891L;
43
44 private boolean editAuthz;
45 private boolean viewAuthz;
46
47 private String namespaceAttribute;
48 private String componentAttribute;
49 private String idAttribute;
50
51 private Map<String, String> additionalPermissionDetails;
52 private Map<String, String> additionalRoleQualifiers;
53
54 public ComponentSecurity() {
55 editAuthz = false;
56 viewAuthz = false;
57
58 additionalPermissionDetails = new HashMap<String, String>();
59 additionalRoleQualifiers = new HashMap<String, String>();
60 }
61
62
63
64
65
66
67 @BeanTagAttribute(name="editAuthz")
68 public boolean isEditAuthz() {
69 return editAuthz;
70 }
71
72
73
74
75
76
77 public void setEditAuthz(boolean editAuthz) {
78 this.editAuthz = editAuthz;
79 }
80
81
82
83
84
85
86 @BeanTagAttribute(name="viewAuthz")
87 public boolean isViewAuthz() {
88 return viewAuthz;
89 }
90
91
92
93
94
95
96 public void setViewAuthz(boolean viewAuthz) {
97 this.viewAuthz = viewAuthz;
98 }
99
100
101
102
103
104
105
106
107
108
109
110 @BeanTagAttribute(name="namespaceAttribute")
111 public String getNamespaceAttribute() {
112 return namespaceAttribute;
113 }
114
115
116
117
118
119
120 public void setNamespaceAttribute(String namespaceAttribute) {
121 this.namespaceAttribute = namespaceAttribute;
122 }
123
124
125
126
127
128
129
130
131
132
133
134 @BeanTagAttribute(name="componentAttribute")
135 public String getComponentAttribute() {
136 return componentAttribute;
137 }
138
139
140
141
142
143
144 public void setComponentAttribute(String componentAttribute) {
145 this.componentAttribute = componentAttribute;
146 }
147
148
149
150
151
152
153
154
155
156
157
158 @BeanTagAttribute(name="idAttribute")
159 public String getIdAttribute() {
160 return idAttribute;
161 }
162
163
164
165
166
167
168 public void setIdAttribute(String idAttribute) {
169 this.idAttribute = idAttribute;
170 }
171
172
173
174
175
176
177
178
179
180
181
182 @BeanTagAttribute(name="additionalPermissionDetails",type= BeanTagAttribute.AttributeType.MAPVALUE)
183 public Map<String, String> getAdditionalPermissionDetails() {
184 return additionalPermissionDetails;
185 }
186
187
188
189
190
191
192 public void setAdditionalPermissionDetails(Map<String, String> additionalPermissionDetails) {
193 this.additionalPermissionDetails = additionalPermissionDetails;
194 }
195
196
197
198
199
200
201
202
203
204
205
206 @BeanTagAttribute(name="additionalRoleQualifiers",type= BeanTagAttribute.AttributeType.MAPVALUE)
207 public Map<String, String> getAdditionalRoleQualifiers() {
208 return additionalRoleQualifiers;
209 }
210
211
212
213
214
215
216 public void setAdditionalRoleQualifiers(Map<String, String> additionalRoleQualifiers) {
217 this.additionalRoleQualifiers = additionalRoleQualifiers;
218 }
219
220 @Override
221 protected void finalize() throws Throwable {
222 try {
223 idAttribute = null;
224 componentAttribute = null;
225 namespaceAttribute = null;
226 additionalRoleQualifiers = null;
227 additionalPermissionDetails = null;
228 } finally {
229
230 }
231 }
232
233
234
235
236
237
238 public <T> T copy() {
239 T copiedClass = null;
240 try {
241 copiedClass = (T)this.getClass().newInstance();
242 }
243 catch(Exception exception) {
244 throw new RuntimeException();
245 }
246
247 copyProperties(copiedClass);
248
249 return copiedClass;
250 }
251
252 protected <T> void copyProperties(T componentSecurity) {
253 super.copyProperties(componentSecurity);
254 ComponentSecurity componentSecurityCopy = (ComponentSecurity) componentSecurity;
255
256 if (this.additionalPermissionDetails != null) {
257 componentSecurityCopy.setAdditionalPermissionDetails(new HashMap<String, String>(this.additionalPermissionDetails));
258 }
259
260 if (this.additionalRoleQualifiers != null) {
261 componentSecurityCopy.setAdditionalRoleQualifiers(new HashMap<String, String>(this.additionalRoleQualifiers));
262 }
263
264 componentSecurityCopy.setComponentAttribute(this.componentAttribute);
265 componentSecurityCopy.setEditAuthz(this.editAuthz);
266 componentSecurityCopy.setIdAttribute(this.idAttribute);
267 componentSecurityCopy.setNamespaceAttribute(this.namespaceAttribute);
268 componentSecurityCopy.setViewAuthz(this.viewAuthz);
269 }
270 }