Example usage for com.liferay.portal.kernel.util PortletKeys WORKFLOW_DEFINITION

List of usage examples for com.liferay.portal.kernel.util PortletKeys WORKFLOW_DEFINITION

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PortletKeys WORKFLOW_DEFINITION.

Prototype

String WORKFLOW_DEFINITION

To view the source code for com.liferay.portal.kernel.util PortletKeys WORKFLOW_DEFINITION.

Click Source Link

Usage

From source file:com.liferay.message.boards.service.permission.MBDiscussionPermission.java

License:Open Source License

public static boolean contains(PermissionChecker permissionChecker, MBMessage message, String actionId)
        throws PortalException {

    String className = message.getClassName();

    if (className.equals(WorkflowInstance.class.getName())) {
        return permissionChecker.hasPermission(message.getGroupId(), PortletKeys.WORKFLOW_DEFINITION,
                message.getGroupId(), ActionKeys.VIEW);
    }//from   w w  w  . j  a va 2s.co  m

    if (PropsValues.DISCUSSION_COMMENTS_ALWAYS_EDITABLE_BY_OWNER
            && (permissionChecker.getUserId() == message.getUserId())) {

        return true;
    }

    if (message.isPending()) {
        Boolean hasPermission = WorkflowPermissionUtil.hasPermission(permissionChecker, message.getGroupId(),
                message.getWorkflowClassName(), message.getMessageId(), actionId);

        if (hasPermission != null) {
            return hasPermission.booleanValue();
        }
    }

    return contains(permissionChecker, message.getCompanyId(), message.getGroupId(), className,
            message.getClassPK(), actionId);
}