| 238 | } |
| 239 | |
| 240 | public static boolean hasAuth(String authPassport) throws MyException { |
| 241 | LoginInfoDto user = Tools.getUser(); |
| 242 | if(user == null ){ |
| 243 | throw new MyException("000003"); |
| 244 | } |
| 245 | |
| 246 | String authority = user.getAuthStr(); |
| 247 | if( user != null && (","+user.getRoleId()).indexOf(","+Const.SUPER+",")>=0){ |
| 248 | return true;//超级管理员 |
| 249 | } |
| 250 | |
| 251 | // 管理员修改自己的资料 |
| 252 | if(authPassport.equals("USER")){ |
| 253 | // 如果session中的管理员id和参数中的id一致 |
| 254 | if( MyString.isEquals( user.getId(), user.getId() ) ){ |
| 255 | return true; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | if(authority.indexOf(","+authPassport+",")>=0){ |
| 260 | return true; |
| 261 | } |
| 262 | throw new MyException("000003"); |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * 构造查询Map集合 |