View Javadoc
1   /*
2    * Copyright 2009 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 1.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl1.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.sec.businessobject;
17  
18  import java.util.ArrayList;
19  import java.util.LinkedHashMap;
20  import java.util.List;
21  
22  import org.kuali.ole.sys.OLEPropertyConstants;
23  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
24  import org.kuali.rice.core.api.util.type.KualiInteger;
25  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26  
27  /**
28   * Defines a restriction that can be given to a model or principal. A restriction defines the attribute that is restricted on, and the action(s) that are being restricted. A KIM
29   * permission and role is created from a definition record
30   */
31  public class SecurityDefinition extends PersistableBusinessObjectBase implements MutableInactivatable {
32      private KualiInteger id;
33      private String name;
34      private String description;
35      private String roleId;
36      private KualiInteger attributeId;
37      private boolean restrictViewAccountingLine;
38      private boolean restrictEditAccountingLine;
39      private boolean restrictViewDocument;
40      private boolean restrictEditDocument;
41      private boolean restrictViewNotesAndAttachments;
42      private boolean restrictLookup;
43      private boolean restrictGLInquiry;
44      private boolean restrictLaborInquiry;
45      private boolean active;
46  
47      private SecurityAttribute securityAttribute;
48  
49      private List<SecurityDefinitionDocumentType> definitionDocumentTypes;
50  
51      public SecurityDefinition() {
52          super();
53  
54          definitionDocumentTypes = new ArrayList<SecurityDefinitionDocumentType>();
55  
56          restrictViewAccountingLine = false;
57          restrictEditAccountingLine = false;
58          restrictViewDocument = false;
59          restrictEditDocument = false;
60          restrictViewNotesAndAttachments = false;
61          restrictLookup = false;
62          restrictGLInquiry = false;
63          restrictLaborInquiry = false;
64      }
65  
66      /**
67       * Gets the id attribute.
68       * 
69       * @return Returns the id.
70       */
71      public KualiInteger getId() {
72          return id;
73      }
74  
75  
76      /**
77       * Sets the id attribute value.
78       * 
79       * @param id The id to set.
80       */
81      public void setId(KualiInteger id) {
82          this.id = id;
83      }
84  
85  
86      /**
87       * Gets the name attribute.
88       * 
89       * @return Returns the name.
90       */
91      public String getName() {
92          return name;
93      }
94  
95  
96      /**
97       * Sets the name attribute value.
98       * 
99       * @param name The name to set.
100      */
101     public void setName(String name) {
102         this.name = name;
103     }
104 
105 
106     /**
107      * Gets the description attribute.
108      * 
109      * @return Returns the description.
110      */
111     public String getDescription() {
112         return description;
113     }
114 
115 
116     /**
117      * Sets the description attribute value.
118      * 
119      * @param description The description to set.
120      */
121     public void setDescription(String description) {
122         this.description = description;
123     }
124 
125 
126     /**
127      * Gets the roleId attribute.
128      * 
129      * @return Returns the roleId.
130      */
131     public String getRoleId() {
132         return roleId;
133     }
134 
135     /**
136      * Sets the roleId attribute value.
137      * 
138      * @param roleId The roleId to set.
139      */
140     public void setRoleId(String roleId) {
141         this.roleId = roleId;
142     }
143 
144     /**
145      * Gets the attributeId attribute.
146      * 
147      * @return Returns the attributeId.
148      */
149     public KualiInteger getAttributeId() {
150         return attributeId;
151     }
152 
153 
154     /**
155      * Sets the attributeId attribute value.
156      * 
157      * @param attributeId The attributeId to set.
158      */
159     public void setAttributeId(KualiInteger attributeId) {
160         this.attributeId = attributeId;
161     }
162 
163 
164     /**
165      * Gets the restrictViewAccountingLine attribute.
166      * 
167      * @return Returns the restrictViewAccountingLine.
168      */
169     public boolean isRestrictViewAccountingLine() {
170         return restrictViewAccountingLine;
171     }
172 
173 
174     /**
175      * Sets the restrictViewAccountingLine attribute value.
176      * 
177      * @param restrictViewAccountingLine The restrictViewAccountingLine to set.
178      */
179     public void setRestrictViewAccountingLine(boolean restrictViewAccountingLine) {
180         this.restrictViewAccountingLine = restrictViewAccountingLine;
181     }
182 
183 
184     /**
185      * Gets the restrictEditAccountingLine attribute.
186      * 
187      * @return Returns the restrictEditAccountingLine.
188      */
189     public boolean isRestrictEditAccountingLine() {
190         return restrictEditAccountingLine;
191     }
192 
193 
194     /**
195      * Sets the restrictEditAccountingLine attribute value.
196      * 
197      * @param restrictEditAccountingLine The restrictEditAccountingLine to set.
198      */
199     public void setRestrictEditAccountingLine(boolean restrictEditAccountingLine) {
200         this.restrictEditAccountingLine = restrictEditAccountingLine;
201     }
202 
203 
204     /**
205      * Gets the restrictViewDocument attribute.
206      * 
207      * @return Returns the restrictViewDocument.
208      */
209     public boolean isRestrictViewDocument() {
210         return restrictViewDocument;
211     }
212 
213 
214     /**
215      * Sets the restrictViewDocument attribute value.
216      * 
217      * @param restrictViewDocument The restrictViewDocument to set.
218      */
219     public void setRestrictViewDocument(boolean restrictViewDocument) {
220         this.restrictViewDocument = restrictViewDocument;
221     }
222 
223 
224     /**
225      * Gets the restrictViewNotesAndAttachments attribute.
226      * 
227      * @return Returns the restrictViewNotesAndAttachments.
228      */
229     public boolean isRestrictViewNotesAndAttachments() {
230         return restrictViewNotesAndAttachments;
231     }
232 
233 
234     /**
235      * Sets the restrictViewNotesAndAttachments attribute value.
236      * 
237      * @param restrictViewNotesAndAttachments The restrictViewNotesAndAttachments to set.
238      */
239     public void setRestrictViewNotesAndAttachments(boolean restrictViewNotesAndAttachments) {
240         this.restrictViewNotesAndAttachments = restrictViewNotesAndAttachments;
241     }
242 
243 
244     /**
245      * Gets the restrictLookup attribute.
246      * 
247      * @return Returns the restrictLookup.
248      */
249     public boolean isRestrictLookup() {
250         return restrictLookup;
251     }
252 
253 
254     /**
255      * Sets the restrictLookup attribute value.
256      * 
257      * @param restrictLookup The restrictLookup to set.
258      */
259     public void setRestrictLookup(boolean restrictLookup) {
260         this.restrictLookup = restrictLookup;
261     }
262 
263 
264     /**
265      * Gets the restrictGLInquiry attribute.
266      * 
267      * @return Returns the restrictGLInquiry.
268      */
269     public boolean isRestrictGLInquiry() {
270         return restrictGLInquiry;
271     }
272 
273 
274     /**
275      * Sets the restrictGLInquiry attribute value.
276      * 
277      * @param restrictGLInquiry The restrictGLInquiry to set.
278      */
279     public void setRestrictGLInquiry(boolean restrictGLInquiry) {
280         this.restrictGLInquiry = restrictGLInquiry;
281     }
282 
283 
284     /**
285      * Gets the restrictLaborInquiry attribute.
286      * 
287      * @return Returns the restrictLaborInquiry.
288      */
289     public boolean isRestrictLaborInquiry() {
290         return restrictLaborInquiry;
291     }
292 
293 
294     /**
295      * Sets the restrictLaborInquiry attribute value.
296      * 
297      * @param restrictLaborInquiry The restrictLaborInquiry to set.
298      */
299     public void setRestrictLaborInquiry(boolean restrictLaborInquiry) {
300         this.restrictLaborInquiry = restrictLaborInquiry;
301     }
302 
303 
304     /**
305      * Gets the active attribute.
306      * 
307      * @return Returns the active.
308      */
309     public boolean isActive() {
310         return active;
311     }
312 
313 
314     /**
315      * Sets the active attribute value.
316      * 
317      * @param active The active to set.
318      */
319     public void setActive(boolean active) {
320         this.active = active;
321     }
322 
323 
324     /**
325      * Gets the securityAttribute attribute.
326      * 
327      * @return Returns the securityAttribute.
328      */
329     public SecurityAttribute getSecurityAttribute() {
330         return securityAttribute;
331     }
332 
333 
334     /**
335      * Sets the securityAttribute attribute value.
336      * 
337      * @param securityAttribute The securityAttribute to set.
338      */
339     public void setSecurityAttribute(SecurityAttribute securityAttribute) {
340         this.securityAttribute = securityAttribute;
341     }
342 
343 
344     /**
345      * Gets the restrictEditDocument attribute.
346      * 
347      * @return Returns the restrictEditDocument.
348      */
349     public boolean isRestrictEditDocument() {
350         return restrictEditDocument;
351     }
352 
353 
354     /**
355      * Sets the restrictEditDocument attribute value.
356      * 
357      * @param restrictEditDocument The restrictEditDocument to set.
358      */
359     public void setRestrictEditDocument(boolean restrictEditDocument) {
360         this.restrictEditDocument = restrictEditDocument;
361     }
362 
363 
364     /**
365      * Gets the definitionDocumentTypes attribute.
366      * 
367      * @return Returns the definitionDocumentTypes.
368      */
369     public List<SecurityDefinitionDocumentType> getDefinitionDocumentTypes() {
370         return definitionDocumentTypes;
371     }
372 
373 
374     /**
375      * Sets the definitionDocumentTypes attribute value.
376      * 
377      * @param definitionDocumentTypes The definitionDocumentTypes to set.
378      */
379     public void setDefinitionDocumentTypes(List<SecurityDefinitionDocumentType> definitionDocumentTypes) {
380         this.definitionDocumentTypes = definitionDocumentTypes;
381     }
382 
383     @Override
384     public String toString() {
385         StringBuilder builder = new StringBuilder();
386         builder.append("SecurityDefinition [");
387         if (id != null) {
388             builder.append("id=");
389             builder.append(id);
390             builder.append(", ");
391         }
392         if (name != null) {
393             builder.append("name=");
394             builder.append(name);
395             builder.append(", ");
396         }
397         if (description != null) {
398             builder.append("description=");
399             builder.append(description);
400             builder.append(", ");
401         }
402         if (roleId != null) {
403             builder.append("roleId=");
404             builder.append(roleId);
405             builder.append(", ");
406         }
407         if (attributeId != null) {
408             builder.append("attributeId=");
409             builder.append(attributeId);
410             builder.append(", ");
411         }
412         builder.append("restrictViewAccountingLine=");
413         builder.append(restrictViewAccountingLine);
414         builder.append(", restrictEditAccountingLine=");
415         builder.append(restrictEditAccountingLine);
416         builder.append(", restrictViewDocument=");
417         builder.append(restrictViewDocument);
418         builder.append(", restrictEditDocument=");
419         builder.append(restrictEditDocument);
420         builder.append(", restrictViewNotesAndAttachments=");
421         builder.append(restrictViewNotesAndAttachments);
422         builder.append(", restrictLookup=");
423         builder.append(restrictLookup);
424         builder.append(", restrictGLInquiry=");
425         builder.append(restrictGLInquiry);
426         builder.append(", restrictLaborInquiry=");
427         builder.append(restrictLaborInquiry);
428         builder.append(", active=");
429         builder.append(active);
430         builder.append(", ");
431         if (securityAttribute != null) {
432             builder.append("securityAttribute=");
433             builder.append(securityAttribute);
434             builder.append(", ");
435         }
436         if (definitionDocumentTypes != null) {
437             builder.append("definitionDocumentTypes=");
438             builder.append(definitionDocumentTypes);
439         }
440         builder.append("]");
441         return builder.toString();
442     }
443 
444 
445 }