Guest User

Untitled

a guest
Jun 23rd, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. /*
  2. * 版权所有 (C) 2001-2009 深圳市凌亚科技有限公司。保留所有权利。
  3. * 版本:
  4. * 修改记录:
  5. * 1、2009-4-27,dengwei 创建。
  6. */
  7. package com.ly.bms.manage;
  8.  
  9. import javax.servlet.http.HttpSession;
  10. import javax.servlet.jsp.PageContext;
  11.  
  12. import com.ly.bms.SysOperatorManage;
  13. import com.zoulab.web.mvc.OnLine;
  14. import com.zoulab.web.mvc.core.Rule;
  15.  
  16. /**
  17. * 页面验证是否有管理员权限,返回boolean =true表示有,=false表示没有
  18. *
  19. * 返回值用于<tag:rule/>标签,用于判断是否显示
  20. */
  21. public class ChkAdminRule implements Rule
  22. {
  23.  
  24. public boolean validateRule(String path, PageContext page) throws Exception
  25. {
  26. HttpSession session = page.getSession();
  27. SysOperatorManage user = (SysOperatorManage) session.getAttribute(OnLine.USER_SESSION_KEY);
  28. if(user==null)
  29. {
  30. return false;
  31. }
  32. return user.getOperatorType()==1;
  33. }
  34.  
  35. }
Add Comment
Please, Sign In to add comment