|
@@ -44,6 +44,7 @@ import cn.com.qmth.examcloud.core.basic.dao.RoleRepo;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.AppEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.AppEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.PrivilegeEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.PrivilegeEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.PrivilegeGroupEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.PrivilegeGroupEntity;
|
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.RolePrivilegeRelationEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.RolePrivilegeRelationEntity;
|
|
import cn.com.qmth.examcloud.core.basic.service.RolePrivilegeService;
|
|
import cn.com.qmth.examcloud.core.basic.service.RolePrivilegeService;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -84,15 +85,20 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
@Autowired
|
|
@Autowired
|
|
RolePrivilegeService rolePrivilegeService;
|
|
RolePrivilegeService rolePrivilegeService;
|
|
|
|
|
|
- @ApiOperation(value = "查询所有角色", notes = "")
|
|
|
|
- @PostMapping("getAllRoles")
|
|
|
|
- public List<RoleBean> getAllRoles(@RequestParam Boolean withSuperAdmin) {
|
|
|
|
- List<cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity> roleList = roleRepo.findAll();
|
|
|
|
|
|
+ @ApiOperation(value = "查询角色", notes = "")
|
|
|
|
+ @PostMapping("getRoles")
|
|
|
|
+ public List<RoleBean> getRoles(@RequestParam Boolean includeSuperAdmin,
|
|
|
|
+ @RequestParam Long rootOrgId) {
|
|
|
|
+ List<RoleEntity> roleList = roleRepo.findByRootOrgIdIsNull();
|
|
|
|
+ if (null != rootOrgId) {
|
|
|
|
+ List<RoleEntity> rootOrgRoleList = roleRepo.findByRootOrgId(rootOrgId);
|
|
|
|
+ roleList.addAll(rootOrgRoleList);
|
|
|
|
+ }
|
|
List<RoleBean> roleBeanList = Lists.newArrayList();
|
|
List<RoleBean> roleBeanList = Lists.newArrayList();
|
|
|
|
|
|
- for (cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity cur : roleList) {
|
|
|
|
|
|
+ for (RoleEntity cur : roleList) {
|
|
|
|
|
|
- if ((!withSuperAdmin) && cur.getCode().equals(RoleMeta.SUPER_ADMIN.name())) {
|
|
|
|
|
|
+ if ((!includeSuperAdmin) && cur.getCode().equals(RoleMeta.SUPER_ADMIN.name())) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|