Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 版权所有 (C) 2001-2009 深圳市凌亚科技有限公司。保留所有权利。
- * 版本:
- * 修改记录:
- * 1、2009-4-27,dengwei 创建。
- */
- package com.ly.bms.manage;
- import javax.servlet.http.HttpSession;
- import javax.servlet.jsp.PageContext;
- import com.ly.bms.SysOperatorManage;
- import com.zoulab.web.mvc.OnLine;
- import com.zoulab.web.mvc.core.Rule;
- /**
- * 页面验证是否有管理员权限,返回boolean =true表示有,=false表示没有
- *
- * 返回值用于<tag:rule/>标签,用于判断是否显示
- */
- public class ChkAdminRule implements Rule
- {
- public boolean validateRule(String path, PageContext page) throws Exception
- {
- HttpSession session = page.getSession();
- SysOperatorManage user = (SysOperatorManage) session.getAttribute(OnLine.USER_SESSION_KEY);
- if(user==null)
- {
- return false;
- }
- return user.getOperatorType()==1;
- }
- }
Add Comment
Please, Sign In to add comment