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