用户权限控制

当前用户只查看当前用户的创业导师: Action 获取当前用户的id: // liwentao 2017-5-18 获取用户ID方法

 LoginContext loginContext=getLoginContext(); //声明用户id得到获取的ID String addusercode=loginContext.getUserCode();

//把声明的id加入到查询方法里面。   List<SpaceInstructorInfoEntity> list = spaceInstructorInfoManager.getInstructorListByParam(queryWay, search, instructorname, currentstate, pagination, addusercode);

Dao层 添加了字段String addusercode :不能固定死权限所以必须从用户选取 public List<SpaceInstructorInfoEntity> getInstructorListByParam(String queryWay,String search, String instruName, String currState, Pagination pagination, String addusercode) { Session session = this.getSession(); StringBuffer buffer = new StringBuffer(); buffer.append(" from SpaceInstructorInfoEntity s where valid = 'Y' and addusercode='"+addusercode+"' ");//2017-05-18 李文涛-DEV00208812《and addusercode='"+addusercode+"' 》 }

Service层: /**      * 创业导师维护主控查询      *      * @param instruName      * @param currState      * @param pagination      * @return List<SpaceInstructorInfoEntity>      */     public List<SpaceInstructorInfoEntity> getInstructorListByParam(String queryWay, String search, String instruName, String currState, Pagination pagination,String addusercode) {         return spaceInstructorInfoDao.getInstructorListByParam(queryWay, search, instruName, currState, pagination,addusercode);

回显设置:

<input id="update_parkname1" name="update_parkname1" value="html" type="text" style="width:180px" disabled />

 var html=$("#pne3").html();
 $("#add_parkname1").val(html);

posted on 2017-06-12 18:25  街角的守望者  阅读(136)  评论(0编辑  收藏  举报

导航