remove role permissions control
This commit is contained in:
parent
1de25f4135
commit
fdf5befa8e
7
.idea/workspace.xml
generated
7
.idea/workspace.xml
generated
@ -3,8 +3,11 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e4baaf01-a2c2-445d-98a1-9f4c50c148cf" name="Default Changelist" comment="">
|
<list default="true" id="e4baaf01-a2c2-445d-98a1-9f4c50c148cf" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/entity/UserEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/entity/UserEntity.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/modules/sys/controller/SysRoleController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/modules/sys/controller/SysRoleController.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/resources/logback-spring.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/logback-spring.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/resources/logback-spring.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/logback-spring.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/resources/mapper/sys/SysUserDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/sys/SysUserDao.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/entity/UserEntity.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/entity/UserEntity.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/sys/controller/SysRoleController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/sys/controller/SysRoleController.class" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@ -172,7 +175,7 @@
|
|||||||
<workItem from="1588163384182" duration="74761000" />
|
<workItem from="1588163384182" duration="74761000" />
|
||||||
<workItem from="1588936950753" duration="95758000" />
|
<workItem from="1588936950753" duration="95758000" />
|
||||||
<workItem from="1590038091791" duration="38394000" />
|
<workItem from="1590038091791" duration="38394000" />
|
||||||
<workItem from="1590136970394" duration="26305000" />
|
<workItem from="1590136970394" duration="27311000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import java.util.Date;
|
|||||||
* @author Mark sunlightcs@gmail.com
|
* @author Mark sunlightcs@gmail.com
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("sys_user")
|
@TableName("tb_user")
|
||||||
public class UserEntity implements Serializable {
|
public class UserEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -32,10 +32,6 @@ public class UserEntity implements Serializable {
|
|||||||
@TableId
|
@TableId
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
private String realName;
|
|
||||||
|
|
||||||
private String userNo;
|
|
||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2020 fumeiai All rights reserved.
|
* Copyright (c) 2020 fumeiai All rights reserved.
|
||||||
*
|
* <p>
|
||||||
*
|
* <p>
|
||||||
*
|
* <p>
|
||||||
* 版权所有,侵权必究!
|
* 版权所有,侵权必究!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -32,98 +32,98 @@ import java.util.Map;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/sys/role")
|
@RequestMapping("/sys/role")
|
||||||
public class SysRoleController extends AbstractController {
|
public class SysRoleController extends AbstractController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleService sysRoleService;
|
private SysRoleService sysRoleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleMenuService sysRoleMenuService;
|
private SysRoleMenuService sysRoleMenuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色列表
|
* 角色列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RequiresPermissions("sys:role:list")
|
@RequiresPermissions("sys:role:list")
|
||||||
public R list(@RequestParam Map<String, Object> params){
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
//如果不是超级管理员,则只查询自己创建的角色列表
|
//如果不是超级管理员,则只查询自己创建的角色列表
|
||||||
if(getUserId() != Constant.SUPER_ADMIN){
|
// if(getUserId() != Constant.SUPER_ADMIN){
|
||||||
params.put("createUserId", getUserId());
|
// params.put("createUserId", getUserId());
|
||||||
}
|
// }
|
||||||
|
|
||||||
PageUtils page = sysRoleService.queryPage(params);
|
PageUtils page = sysRoleService.queryPage(params);
|
||||||
|
|
||||||
return R.ok().put("page", page);
|
return R.ok().put("page", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色列表
|
* 角色列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/select")
|
@GetMapping("/select")
|
||||||
@RequiresPermissions("sys:role:select")
|
@RequiresPermissions("sys:role:select")
|
||||||
public R select(){
|
public R select() {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
//如果不是超级管理员,则只查询自己所拥有的角色列表
|
//如果不是超级管理员,则只查询自己所拥有的角色列表
|
||||||
if(getUserId() != Constant.SUPER_ADMIN){
|
// if(getUserId() != Constant.SUPER_ADMIN){
|
||||||
map.put("create_user_id", getUserId());
|
// map.put("create_user_id", getUserId());
|
||||||
}
|
// }
|
||||||
List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map);
|
List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map);
|
||||||
|
|
||||||
return R.ok().put("list", list);
|
return R.ok().put("list", list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色信息
|
* 角色信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/info/{roleId}")
|
@GetMapping("/info/{roleId}")
|
||||||
@RequiresPermissions("sys:role:info")
|
@RequiresPermissions("sys:role:info")
|
||||||
public R info(@PathVariable("roleId") Long roleId){
|
public R info(@PathVariable("roleId") Long roleId) {
|
||||||
SysRoleEntity role = sysRoleService.getById(roleId);
|
SysRoleEntity role = sysRoleService.getById(roleId);
|
||||||
|
|
||||||
//查询角色对应的菜单
|
//查询角色对应的菜单
|
||||||
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
|
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
|
||||||
role.setMenuIdList(menuIdList);
|
role.setMenuIdList(menuIdList);
|
||||||
|
|
||||||
return R.ok().put("role", role);
|
return R.ok().put("role", role);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存角色
|
* 保存角色
|
||||||
*/
|
*/
|
||||||
@SysLog("保存角色")
|
@SysLog("保存角色")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresPermissions("sys:role:save")
|
@RequiresPermissions("sys:role:save")
|
||||||
public R save(@RequestBody SysRoleEntity role){
|
public R save(@RequestBody SysRoleEntity role) {
|
||||||
ValidatorUtils.validateEntity(role);
|
ValidatorUtils.validateEntity(role);
|
||||||
|
|
||||||
role.setCreateUserId(getUserId());
|
role.setCreateUserId(getUserId());
|
||||||
sysRoleService.saveRole(role);
|
sysRoleService.saveRole(role);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改角色
|
* 修改角色
|
||||||
*/
|
*/
|
||||||
@SysLog("修改角色")
|
@SysLog("修改角色")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@RequiresPermissions("sys:role:update")
|
@RequiresPermissions("sys:role:update")
|
||||||
public R update(@RequestBody SysRoleEntity role){
|
public R update(@RequestBody SysRoleEntity role) {
|
||||||
ValidatorUtils.validateEntity(role);
|
ValidatorUtils.validateEntity(role);
|
||||||
|
|
||||||
role.setCreateUserId(getUserId());
|
role.setCreateUserId(getUserId());
|
||||||
sysRoleService.update(role);
|
sysRoleService.update(role);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除角色
|
* 删除角色
|
||||||
*/
|
*/
|
||||||
@SysLog("删除角色")
|
@SysLog("删除角色")
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@RequiresPermissions("sys:role:delete")
|
@RequiresPermissions("sys:role:delete")
|
||||||
public R delete(@RequestBody Long[] roleIds){
|
public R delete(@RequestBody Long[] roleIds) {
|
||||||
sysRoleService.deleteBatch(roleIds);
|
sysRoleService.deleteBatch(roleIds);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user