/*
 * Copyright 2005-2010 The Kuali Foundation
 * 
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.osedu.org/licenses/ECL-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.kra.irb.auth;

import org.apache.commons.lang.StringUtils;
import org.kuali.kra.infrastructure.PermissionConstants;
import org.kuali.kra.irb.Protocol;
import org.kuali.kra.irb.actions.ProtocolActionType;
import org.kuali.kra.irb.actions.submit.ProtocolSubmissionStatus;

/**
 * Is the user allowed to notify the IRB office?
 */
public class NotifyCommitteeAuthorizer extends ProtocolAuthorizer {

    /**
     * @see org.kuali.kra.irb.auth.ProtocolAuthorizer#isAuthorized(java.lang.String, org.kuali.kra.irb.auth.ProtocolTask)
     */
    public boolean isAuthorized(String userId, ProtocolTask task) {
boolean result = isStatusValid(task.getProtocol()) &&
                 canExecuteAction(task.getProtocol(), ProtocolActionType.NOTIFIED_COMMITTEE) &&
                 hasPermission(userId, task.getProtocol(), PermissionConstants.PERFORM_IRB_ACTIONS_ON_PROTO);
System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAA returning " + result);
return result;
//        return isStatusValid(task.getProtocol()) &&
//        canExecuteAction(task.getProtocol(), ProtocolActionType.NOTIFIED_COMMITTEE) &&
//        hasPermission(userId, task.getProtocol(), PermissionConstants.PERFORM_IRB_ACTIONS_ON_PROTO);
    }
    
    private boolean isStatusValid(Protocol protocol) {
        String submissionStatusCode = protocol.getProtocolSubmission().getSubmissionStatus().getProtocolSubmissionStatusCode();
        return StringUtils.isNotBlank(submissionStatusCode)
                && (ProtocolSubmissionStatus.SUBMITTED_TO_COMMITTEE.equals(submissionStatusCode));
    }

}

@@ -1236,354 +1236,8 @@
 ) %7B%0A
-boolean result = isStatusValid(task.getProtocol()) &&%0A                 canExecuteAction(task.getProtocol(), ProtocolActionType.NOTIFIED_COMMITTEE) &&%0A                 hasPermission(userId, task.getProtocol(), PermissionConstants.PERFORM_IRB_ACTIONS_ON_PROTO);%0ASystem.out.println(%22AAAAAAAAAAAAAAAAAAAAAAAAA returning %22 + result);%0Areturn result;%0A//
     
@@ -1280,26 +1280,24 @@
 tocol()) &&%0A
-//
         canE
@@ -1371,18 +1371,16 @@
 TEE) &&%0A
-//
         

Create IACUC Actions infrastructure, initial tag files, etc etc - this file must have been inadvertently committed along with other fixes. So take debug stmts back out.