View Javadoc
1   /*
2    * Copyright 2010 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.datadictionary;
17  
18  import org.kuali.ole.sec.document.authorization.SecAccountingLineAuthorizer;
19  import org.kuali.ole.sys.document.authorization.AccountingLineAuthorizer;
20  import org.kuali.ole.sys.document.datadictionary.AccountingLineGroupDefinition;
21  
22  
23  /**
24   * Override of group definition to wrap access security around accounting objects
25   */
26  public class SecAccountingLineGroupDefinition extends AccountingLineGroupDefinition {
27  
28      /**
29       * Creates a new instance of the security accounting line authorizer and sets the configured authorizer property
30       * 
31       * @see org.kuali.ole.sys.document.datadictionary.AccountingLineGroupDefinition#createAccountingLineAuthorizer()
32       */
33      @Override
34      protected AccountingLineAuthorizer createAccountingLineAuthorizer() {
35          Class<? extends AccountingLineAuthorizer> authorizerClass = getAccountingLineAuthorizerClass();
36  
37          SecAccountingLineAuthorizer secAuthorizer = new SecAccountingLineAuthorizer();
38          try {
39              AccountingLineAuthorizer authorizer = authorizerClass.newInstance();
40              secAuthorizer.setLineAuthorizer(authorizer);
41          } catch (InstantiationException ie) {
42              throw new IllegalArgumentException("InstantiationException while attempting to instantiate AccountingLineAuthorization class", ie);
43          } catch (IllegalAccessException iae) {
44              throw new IllegalArgumentException("IllegalAccessException while attempting to instantiate AccountingLineAuthorization class", iae);
45          }
46          
47          return secAuthorizer;
48      }
49  
50  }