001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.module.ar.document.authorization;
017    
018    import org.kuali.kfs.sys.document.authorization.FinancialSystemMaintenanceDocumentAuthorizerBase;
019    
020    public class CustomerAuthorizer extends FinancialSystemMaintenanceDocumentAuthorizerBase {
021    
022        // TODO this is commented out because the old logic doesnt match up the new logic at 
023        //      https://test.kuali.org/confluence/display/KULAR/Document+Types%2C+Approvals 
024    
025        // the rules should be:  persons belonging to AR Biller or AR Processor roles can 
026        // initiate these documents, both Create and Maintain (ie, New and Edit).
027        //
028        // All approvals is done by AR_ROLE_MAINTAINERS (or whatever the KIM group/role equiv of htat is)
029        //
030        // Furthermore, System Super Users should be able to do everything, including BlanketApprove.
031        
032    ///**
033    // * @see org.kuali.rice.kns.document.authorization.MaintenanceDocumentAuthorizerBase#getDocumentActionFlags(org.kuali.rice.kns.document.Document, org.kuali.rice.kim.bo.Person)
034    // */
035    //@Override
036    //public FinancialSystemDocumentActionFlags getDocumentActions(Document document) {
037    //    FinancialSystemDocumentActionFlags actionFlags = super.getDocumentActionFlags(document);
038    //
039    //    MaintenanceDocument maintDocument = (MaintenanceDocument) document;
040    //    String maintenanceAction = maintDocument.getNewMaintainableObject().getMaintenanceAction();
041    //
042    //    //  this is used for batch processing of customer records
043    //    if (KFSConstants.SYSTEM_USER.equalsIgnoreCase(user.getPrincipalName())) {
044    //        actionFlags.setCanApprove(true);
045    //        actionFlags.setCanBlanketApprove(true);
046    //        actionFlags.setCanAdHocRoute(true);
047    //        actionFlags.setCanRoute(true);
048    //        return actionFlags;
049    //    }
050    //
051    //    // if user is not AR SUPERVISOR he cannot approve the customer creation document
052    //    if (KNSConstants.MAINTENANCE_NEW_ACTION.equalsIgnoreCase(maintenanceAction) && !ARUtil.isUserInArSupervisorGroup(user)) {
053    //
054    //        actionFlags.setCanApprove(false);
055    //        actionFlags.setCanBlanketApprove(false);
056    //
057    //    }
058    //
059    //    // if ((maintenanceAction.equalsIgnoreCase(KNSConstants.MAINTENANCE_EDIT_ACTION) ||
060    //    // maintenanceAction.equalsIgnoreCase(KNSConstants.MAINTENANCE_COPY_ACTION)) && !isUserInArSupervisorGroup(user)) {
061    //    //
062    //    // actionFlags.setCanRoute(false);
063    //    // actionFlags.setCanSave(false);
064    //    // actionFlags.setCanCancel(false);
065    //    //
066    //    //        }
067    //    return actionFlags;
068    //}
069    }
070