当前位置: 首页>>代码示例>>Java>>正文


Java DocumentRouteHeaderValue.getCurrentNodeNames方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue.getCurrentNodeNames方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentRouteHeaderValue.getCurrentNodeNames方法的具体用法?Java DocumentRouteHeaderValue.getCurrentNodeNames怎么用?Java DocumentRouteHeaderValue.getCurrentNodeNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue的用法示例。


在下文中一共展示了DocumentRouteHeaderValue.getCurrentNodeNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canSave

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
/**
 * Implements {@link org.kuali.rice.kew.doctype.service.DocumentTypePermissionService#canSave(String, org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue)}
 */
public boolean canSave(String principalId, DocumentRouteHeaderValue document) {
    validatePrincipalId(principalId);
    validateDocument(document);
    String documentId = document.getDocumentId();
    DocumentType documentType = document.getDocumentType();
    String documentStatus = document.getDocRouteStatus();
    String initiatorPrincipalId = document.getInitiatorWorkflowId();
    List<String> routeNodeNames = document.getCurrentNodeNames();
    validateDocumentType(documentType);
    validateRouteNodeNames(routeNodeNames);
    validateDocumentStatus(documentStatus);
    validatePrincipalId(initiatorPrincipalId);

    if (!documentType.isPolicyDefined(org.kuali.rice.kew.api.doctype.DocumentTypePolicy.INITIATOR_MUST_SAVE)) {
        List<Map<String, String>> permissionDetailList = buildDocumentTypePermissionDetailsForNodes(documentType, routeNodeNames, documentStatus, null);

        boolean foundAtLeastOnePermission = false;
        // loop over permission details, only one of them needs to be authorized
        for (Map<String, String> permissionDetails : permissionDetailList) {
            Map<String, String> roleQualifiers = buildDocumentRoleQualifiers(document, permissionDetails.get(KewApiConstants.ROUTE_NODE_NAME_DETAIL));
            if (useKimPermission(KewApiConstants.KEW_NAMESPACE, KewApiConstants.SAVE_PERMISSION, permissionDetails, true)) {
                foundAtLeastOnePermission = true;
                if (getPermissionService().isAuthorizedByTemplate(principalId, KewApiConstants.KEW_NAMESPACE,
                        KewApiConstants.SAVE_PERMISSION, permissionDetails, roleQualifiers)) {
                    return true;
                }
            }
        }
        // if we found defined KIM permissions, but not of them have authorized this user, return false
        if (foundAtLeastOnePermission) {
            return false;
        }
    }

    if (documentType.getInitiatorMustSavePolicy().getPolicyValue()) {
        return executeInitiatorPolicyCheck(principalId, initiatorPrincipalId, documentStatus);
    }
    return true;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:43,代码来源:DocumentActionsPermissionBase.java

示例2: canCancel

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
/**
 * Implements {@link org.kuali.rice.kew.doctype.service.DocumentTypePermissionService#canCancel(String, org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue)}
 */
public boolean canCancel(String principalId, DocumentRouteHeaderValue document) {
    validatePrincipalId(principalId);
    validateDocument(document);
    String documentId = document.getDocumentId();
    DocumentType documentType = document.getDocumentType();
    String documentStatus = document.getDocRouteStatus();
    String initiatorPrincipalId = document.getInitiatorWorkflowId();
    List<String> routeNodeNames = document.getCurrentNodeNames();
    validateDocumentType(documentType);
    validateRouteNodeNames(routeNodeNames);
    validateDocumentStatus(documentStatus);
    validatePrincipalId(initiatorPrincipalId);

    if (!documentType.isPolicyDefined(org.kuali.rice.kew.api.doctype.DocumentTypePolicy.INITIATOR_MUST_CANCEL)) {
        List<Map<String, String>> permissionDetailList = buildDocumentTypePermissionDetailsForNodes(documentType, routeNodeNames, documentStatus, null);

        boolean foundAtLeastOnePermission = false;
        // loop over permission details, only one of them needs to be authorized
        for (Map<String, String> permissionDetails : permissionDetailList) {
            Map<String, String> roleQualifiers = buildDocumentRoleQualifiers(document, permissionDetails.get(KewApiConstants.ROUTE_NODE_NAME_DETAIL));
            if (useKimPermission(KewApiConstants.KEW_NAMESPACE, KewApiConstants.CANCEL_PERMISSION, permissionDetails, true)) {
                foundAtLeastOnePermission = true;
                if (getPermissionService().isAuthorizedByTemplate(principalId, KewApiConstants.KEW_NAMESPACE,
                        KewApiConstants.CANCEL_PERMISSION, permissionDetails, roleQualifiers)) {
                    return true;
                }
            }
        }
        // if we found defined KIM permissions, but not of them have authorized this user, return false
        if (foundAtLeastOnePermission) {
            return false;
        }
    }

    if (documentType.getInitiatorMustCancelPolicy().getPolicyValue()) {
        return executeInitiatorPolicyCheck(principalId, initiatorPrincipalId, documentStatus);
    } else {
        return true;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:44,代码来源:DocumentActionsPermissionBase.java

示例3: canRecall

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
/**
 * Implements {@link org.kuali.rice.kew.doctype.service.DocumentTypePermissionService#canRecall(String, org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue)}
 */
public boolean canRecall(String principalId, DocumentRouteHeaderValue document) {
    validatePrincipalId(principalId);
    validateDocument(document);
    String documentId = document.getDocumentId();
    DocumentType documentType = document.getDocumentType();
    String documentStatus = document.getDocRouteStatus();
    String appDocStatus = document.getAppDocStatus();
    String initiatorPrincipalId = document.getInitiatorWorkflowId();
    List<String> routeNodeNames = document.getCurrentNodeNames();
    validateDocumentType(documentType);
    validateRouteNodeNames(routeNodeNames);
    validateDocumentStatus(documentStatus);
    // no need to validate appdocstatus, this is a free-form application defined value

    // add appDocStatus to the details
    List<Map<String, String>> permissionDetailList = buildDocumentTypePermissionDetailsForNodes(documentType, routeNodeNames, documentStatus, null);
    if (!StringUtils.isBlank(appDocStatus)) {
        for (Map<String, String> details: permissionDetailList) {
            details.put(KewApiConstants.APP_DOC_STATUS_DETAIL, appDocStatus);
        }
    }

    boolean foundAtLeastOnePermission = false;
    boolean authorizedByPermission = false;
    boolean principalIsInitiator = StringUtils.equals(initiatorPrincipalId, principalId);

    // loop over permission details, only one of them needs to be authorized
    for (Map<String, String> permissionDetails : permissionDetailList) {
        Map<String, String> roleQualifiers = buildDocumentRoleQualifiers(document, permissionDetails.get(KewApiConstants.ROUTE_NODE_NAME_DETAIL));
        if (useKimPermission(KewApiConstants.KEW_NAMESPACE, KewApiConstants.RECALL_PERMISSION, permissionDetails, false)) {
            if (getPermissionService().isPermissionDefinedByTemplate(KewApiConstants.KEW_NAMESPACE, KewApiConstants.RECALL_PERMISSION, permissionDetails)) {
                foundAtLeastOnePermission = true;
                if (getPermissionService().isAuthorizedByTemplate(principalId, KewApiConstants.KEW_NAMESPACE,
                        KewApiConstants.RECALL_PERMISSION, permissionDetails, roleQualifiers)) {
                    return true;
                }
            }
        }
    }
    if (foundAtLeastOnePermission) {
        return false;
    }
    // alternative could be to only authorize initiator if the permission is omitted
    // (i.e. exclude initiator if the initiator does not have the recall permission)
    return authorizedByPermission;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:50,代码来源:DocumentActionsPermissionBase.java


注:本文中的org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue.getCurrentNodeNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。