当前位置:网站首页>权限管理-角色分配菜单
权限管理-角色分配菜单
2022-07-25 15:43:00 【Leon_Jinhai_Sun】
//=========================给角色分配菜单=======================就是给中介表加数据
@Override
public void saveRolePermissionRealtionShipGuli(String roleId, String[] permissionIds) {
//roleId角色id
//permissionId菜单id 数组形式
//一个角色有多个菜单,最终以集合的形式批量添加。
//1 创建list集合,用于封装添加数据
List<RolePermission> rolePermissionList = new ArrayList<>();
//遍历所有菜单数组
for(String perId : permissionIds) {
//RolePermission对象
RolePermission rolePermission = new RolePermission();
rolePermission.setRoleId(roleId);
rolePermission.setPermissionId(perId);
//封装到list集合,一条一条加进去
rolePermissionList.add(rolePermission);
}
//添加到角色菜单关系表,批量添加
rolePermissionService.saveBatch(rolePermissionList);
}边栏推荐
- Understand "average load"
- LeetCode - 359 日志速率限制器 (设计)
- CVPR 2022 | 网络中批处理归一化估计偏移的深入研究
- R语言ggplot2可视化线图(line)、自定义配置标题文本相关内容颜色和图例(legend)颜色相匹配(和分组线图的颜色相匹配、match colors of groups)
- 没错,请求DNS服务器还可以使用UDP协议
- BSC智能链合约模式系统开发详情
- MATLAB optimization tool manopt installation
- Understanding of this object
- Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel
- Redis distributed lock, it's really impossible without it
猜你喜欢

General test case writing specification

ML - Speech - Introduction to speech processing

P4552 differential

Beyond Compare 4 实现class文件对比【最新】

JVM - classloader and parental delegation model

LeetCode - 379 电话目录管理系统(设计)

Circulaindicator component, which makes the indicator style more diversified

How matlab saves all the data after running

CVPR 2022 | 网络中批处理归一化估计偏移的深入研究

如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?
随机推荐
Componentization and modularization
LeetCode - 622 设计循环队列 (设计)
CVPR 2022 | 网络中批处理归一化估计偏移的深入研究
Cf750f1 thinking DP
Activity review | July 6 Anyuan AI X machine heart series lecture No. 2 | MIT professor Max tegmark shares "symbiotic evolution of human and AI"
Beyond compare 4 realizes class file comparison [latest]
LeetCode - 303 区域和检索 - 数组不可变 (设计 前缀和数组)
General test case writing specification
Beyond Compare 4 实现class文件对比【最新】
HDD Hangzhou station · harmonyos technical experts share the features of Huawei deveco studio
物理防火墙是什么?有什么作用?
Pytoch learning notes -- Summary of common functions 2
The difference between mouseover and mouseenter
The second revolution of reporting tools
Solve the vender-base.66c6fc1c0b393478adf7.js:6 typeerror: cannot read property 'validate' of undefined problem
Qtime definition (manual waste utilization is simple and beautiful)
How Google cloud disk is associated with Google colab
如何解决跨域问题
MySQL - user and permission control
Introduction to redis