AuthorizeService.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. package jnpf.permission.service;
  2. import jnpf.base.entity.SystemEntity;
  3. import jnpf.base.model.portalManage.PortalModel;
  4. import jnpf.base.model.portalManage.SavePortalAuthModel;
  5. import jnpf.base.service.SuperService;
  6. import jnpf.database.model.superQuery.SuperJsonModel;
  7. import jnpf.model.login.UserSystemVO;
  8. import jnpf.permission.entity.AuthorizeEntity;
  9. import jnpf.permission.model.authorize.AuthorizeDataUpForm;
  10. import jnpf.permission.model.authorize.AuthorizeVO;
  11. import java.util.List;
  12. /**
  13. * 操作权限
  14. *
  15. * @author JNPF开发平台组
  16. * @version V3.1.0
  17. * @copyright 引迈信息技术有限公司
  18. * @date 2019年9月26日 上午9:18
  19. */
  20. public interface AuthorizeService extends SuperService<AuthorizeEntity> {
  21. /**
  22. * 获取当前系统权限列表
  23. *
  24. * @param singletonOrg 是否启用
  25. * @param currentSystemCode 当前系统编码
  26. * @param isBackend 是否后台(当前用户信息用)
  27. * @return
  28. */
  29. AuthorizeVO getAuthorize(boolean singletonOrg, String currentSystemCode, Integer isBackend);
  30. /**
  31. * 全部系统权限
  32. *
  33. * @param singletonOrg
  34. * @return
  35. */
  36. AuthorizeVO getAuthorizeByUser(boolean singletonOrg);
  37. /**
  38. * 获取全部系统的权限
  39. *
  40. * @param singletonOrg 是否启用
  41. * @param currentSystemCode 当前系统编码
  42. * @param isBackend 是否后台(当前用户信息用)
  43. * @return
  44. */
  45. AuthorizeVO getAuthorize(boolean singletonOrg, String currentSystemCode, Integer isBackend, Boolean allSystem);
  46. /**
  47. * 创建
  48. *
  49. * @param authorizeList 实体对象
  50. */
  51. String save(AuthorizeDataUpForm authorizeList);
  52. /**
  53. * 根据用户id获取列表
  54. *
  55. * @param isAdmin 是否管理员
  56. * @param userId 用户主键
  57. * @param standingfilter 是否根据身份过滤(个人权限部分不需要过滤)
  58. * @return
  59. */
  60. List<AuthorizeEntity> getListByUserId(boolean isAdmin, String userId, boolean standingfilter);
  61. /**
  62. * 根据岗位或者角色获取全部权限
  63. *
  64. * @param objectId 岗位/角色id
  65. * @param objectType 类型:岗位-position/角色-role
  66. * @return
  67. */
  68. List<AuthorizeEntity> getListByPosOrRoleId(String objectId, String objectType);
  69. /**
  70. * 根据对象Id获取列表
  71. *
  72. * @param objectId 对象主键
  73. * @return
  74. */
  75. List<AuthorizeEntity> getListByObjectId(List<String> objectId);
  76. /**
  77. * 判断当前角色是否有权限
  78. *
  79. * @param roleId
  80. * @param systemId
  81. * @return
  82. */
  83. Boolean existAuthorize(String roleId, String systemId);
  84. /**
  85. * 判断当前角色是否有权限
  86. *
  87. * @param roleId
  88. * @return
  89. */
  90. List<AuthorizeEntity> getListByRoleId(String roleId);
  91. /**
  92. * 根据对象Id获取列表
  93. *
  94. * @param objectId 对象主键
  95. * @param itemType 对象主键
  96. * @return
  97. */
  98. List<AuthorizeEntity> getListByObjectId(String objectId, String itemType);
  99. /**
  100. * 根据对象Id获取列表
  101. *
  102. * @param objectType 对象主键
  103. * @return
  104. */
  105. List<AuthorizeEntity> getListByObjectAndItem(String itemId, String objectType);
  106. /**
  107. * 根据对象Id获取列表
  108. *
  109. * @param itemId 对象主键
  110. * @param itemType 对象类型
  111. * @return
  112. */
  113. List<AuthorizeEntity> getListByObjectAndItemIdAndType(String itemId, String itemType);
  114. void getPortal(List<SystemEntity> systemList, List<PortalModel> portalList, Long dateTime, List<String> collect);
  115. void saveItemAuth(SavePortalAuthModel portalAuthModel);
  116. void saveObjectAuth(SavePortalAuthModel portalAuthModel);
  117. List<SuperJsonModel> getConditionSql(String moduleId, String systemCode);
  118. /**
  119. * 通过Item获取权限列表
  120. *
  121. * @param itemType
  122. * @param itemId
  123. * @return
  124. */
  125. List<AuthorizeEntity> getAuthorizeByItem(String itemType, String itemId);
  126. List<AuthorizeEntity> getListByRoleIdsAndItemType(List<String> roleIds, String itemType);
  127. List<UserSystemVO> getUserStanding(boolean isLogin, String userId);
  128. List<UserSystemVO> getUserStanding(boolean isLogin, String userId, String loginDevice);
  129. void removeAuthByUserOrMenu(List<String> userIds, List<String> menuIds);
  130. /**
  131. * 获取用户当前身份
  132. *
  133. * @param userId 用户id
  134. * @param standType 身份类型:1-超级管理员,2-管理员,3普通用户
  135. * @return
  136. */
  137. boolean getUserCurrentStanding(String userId, Integer standType);
  138. }