View Javadoc
1   /**
2    * Copyright By Grandsoft Company Limited.  
3    * 2012-2-28 上午10:21:48
4    */
5   package gboat2.web.service;
6   
7   import gboat2.base.bridge.model.UserSession;
8   import gboat2.web.model.Group;
9   import gboat2.web.model.Role;
10  import gboat2.web.model.User;
11  import gboat2.web.model.UserGroupOrganMapper;
12  
13  import java.util.List;
14  import java.util.Map;
15  
16  import javax.servlet.http.HttpServletRequest;
17  
18  /**
19   * 
20   * 用户登录服务
21   * @author lysming
22   * @since jdk1.6
23   * @date 2012-2-28
24   *  
25   */
26  
27  public interface ISessionService {
28  	
29  	public UserSession login(String loginId, String passwd) throws PrivilegeException;
30  	
31  	public UserSession login(String userId, String groupId, String roleId, String systemId) throws PrivilegeException;
32  	
33  	public UserSession login(User user, UserGroupOrganMapper mapper,  String systemId) throws PrivilegeException;
34  	
35  	/**
36  	 * 用户登录,将在多个系统的权限整合
37  	 * @param user
38  	 * @param mappers
39  	 * @return
40  	 * @throws PrivilegeException
41  	 */
42  	public UserSession login(User user, UserGroupOrganMapper mapper) throws PrivilegeException;
43  	
44  	public Role getRoleByCode(String roleCode);
45  	
46  	public Group getGroupByCode(String groupCode);
47  	
48  	/**
49  	 * 获取authorityId,首先判断groupId.roleId是否有权限,有则返回groupId.roleId,没有返回roleId
50  	 * @param groupId 用户组id
51  	 * @param roleId 角色id
52  	 * @return String
53  	 */
54  	public String computeAuthForId(String groupId, String roleId,  String systemId);
55  	
56  	/**
57  	 * 获取session权限表中对应的权限禁止表,即:如果权限表中有某个action的权限,则该action中所有被注解的method除去权限表中的method就为该
58  	 * action的禁止表
59  	 * @param request HttpServletRequest响应请求
60  	 * @return 如果权限表为空,返回null,否则返回权限表对应的禁止表
61  	 * @author tanxw
62  	 */
63  	public Map<String, List<String>> getDeniedPriority(HttpServletRequest request);
64  	
65  	/**获取用户导航菜单树,存放到userSession中
66  	 * @param userSession
67  	 * 			当前登录的userSession
68  	 * @param mapper
69  	 * 			用户角色-组 mapper
70  	 * @return userSession
71  	 */
72  	public UserSession loadNavigationMenuToSession(UserSession userSession, UserGroupOrganMapper mapper);
73  	
74  }