package com.vci.client.common; import javax.swing.JComponent; import javax.swing.JPanel; import com.vci.client.framework.rightConfig.object.FunctionObject; import com.vci.client.framework.util.RightControlUtil; /** * 每个模块的实现类要继承自此PANEL,通过传入的模块对象,处理当前用户在该模块下的权限, * 页面上校验操作权限时只需传入操作的标识即可。 * @author xf * */ public class VCIBasePanel extends JPanel { /** * */ private static final long serialVersionUID = -894240142116864397L; protected static FunctionObject funcObj = null; public VCIBasePanel(FunctionObject funcObj){ this.funcObj = funcObj; } /** * 校验操作权限 * @param operate * @return */ public static boolean checkRight(String operate,JComponent component){ boolean res = RightControlUtil.checkOperateRightByModule(funcObj.getId(), operate); if(component != null){ component.setVisible(res); } return res; } /** * 返回功能模块对象 * return 功能模块FunctionObject对象 */ public FunctionObject getFuncObj(){ return funcObj; } }