【8.0】【role】完善绑定权限增加范围筛选,增加增加绑定菜单功能的筛选

pull/57/head
fengshuonan 2023-09-08 23:06:54 +08:00
parent c1ddd6d62c
commit 3fe5356431
1 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package cn.stylefeng.roses.kernel.sys.modular.role.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.sys.modular.role.action.RoleAssignOperateAction;
import cn.stylefeng.roses.kernel.sys.modular.role.action.RoleBindLimitAction;
import cn.stylefeng.roses.kernel.sys.modular.role.entity.SysRoleLimit;
@ -13,6 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Set;
/**
*
@ -35,11 +37,16 @@ public class RoleBindOptionImpl implements RoleAssignOperateAction, RoleBindLimi
}
@Override
public void doOperateAction(RoleBindPermissionRequest roleBindPermissionRequest) {
public void doOperateAction(RoleBindPermissionRequest roleBindPermissionRequest, Set<Long> roleLimitMenuIdsAndOptionIds) {
Long roleId = roleBindPermissionRequest.getRoleId();
Long menuOptionId = roleBindPermissionRequest.getNodeId();
// 非法操作
if (ObjectUtil.isNotEmpty(roleLimitMenuIdsAndOptionIds) && !roleLimitMenuIdsAndOptionIds.contains(menuOptionId)) {
return;
}
if (roleBindPermissionRequest.getChecked()) {
SysRoleMenuOptions sysRoleMenuOptions = new SysRoleMenuOptions();
sysRoleMenuOptions.setRoleId(roleId);