Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 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.opensource.org/licenses/ecl2.php 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.rice.kew.doctype.service.impl;
Default DocumentTypeAuthorizer implementation which performs KIM checks for authorizable actions.

Since:
2.1.3
    private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(KimDocumentTypeAuthorizer.class);
    @Override
    public Authorization isActionAuthorized(AuthorizableAction actionString principalIdDocumentType documentTypeDocument documentMap<ActionArgumentObjectactionParameters) {
        org.kuali.rice.kew.doctype.bo.DocumentType documentTypeBo = org.kuali.rice.kew.doctype.bo.DocumentType.from(documentType);
        boolean success = false;
        switch (action.type) {
            case :
                success = canInitiate(principalIddocumentTypeBo);
                break;
            case :
                success = canSuperUserApproveSingleActionRequest(principalIddocumentTypeBo, (Collection<String>) actionParameters.get(.), (StringactionParameters.get(.));
                break;
            case :
                switch (action.actionType) {
                    case :
                        success = canBlanketApprove(principalId, DocumentRouteHeaderValue.from(document));
                        break;
                    case :
                        success = canSuperUserApproveDocument(principalIddocumentTypeBo, (Collection<String>) actionParameters.get(.), (StringactionParameters.get(.));
                        break;
                    case :
                        success = canSuperUserDisapproveDocument(principalIddocumentTypeBo, (Collection<String>) actionParameters.get(.), (StringactionParameters.get(.));
                        break;
                    case :
                        success = canCancel(principalId, DocumentRouteHeaderValue.from(document));
                        break;
                    case :
                        success = canRecall(principalId, DocumentRouteHeaderValue.from(document));
                        break;
                    case  :
                        success = canRoute(principalId, DocumentRouteHeaderValue.from(document));
                        break;
                    case :
                        success = canSave(principalId, DocumentRouteHeaderValue.from(document));
                        break;
                    default:
                        throw new RuntimeException("Unknown document action check");
                }
                break;
            default:
                throw new RuntimeException("Unknown authorization check");
        }
        return new Authorization(success);
    }
New to GrepCode? Check out our FAQ X