📄 checkcomplexactivitysecurity.bsh
字号:
/* * Copyright (C) 2006 Open Source Strategies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *//* Copyright (c) 2005-2006 Open Source Strategies, Inc. *//* * This file is called by each screen that has complex Activity security requirements. * To use this script, define the security requirements in the subject screen * as in the following example: * * <actions> * <set field="hasOperationPermission" value="_VIEW"/> * <script location="component://crmsfa/webapp/crmsfa/WEB-INF/actions/security/checkComplexActivitySecurity.bsh"/> * </actions> * * The workEffortId is retrieved from the parameters. * * The script will create a parameter named "allowed" with the Boolean result of the security checks. * By default, the script will return false. * * @author Leon Torres (leon@opensourcestrategies.com) */import com.opensourcestrategies.crmsfa.security.CrmsfaSecurity;operation = context.get("hasOperationPermission");workEffortId = parameters.get("workEffortId");if ((operation == null) || (workEffortId == null)) { context.put("allowed", false); return;}security = request.getAttribute("security");userLogin = request.getAttribute("userLogin");if (CrmsfaSecurity.hasActivityPermission(security, operation, userLogin, workEffortId, context.get("internalPartyId"), context.get("salesOpportunityId"), context.get("custRequestId"))) { context.put("allowed", true); return;}context.put("allowed", false);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -