当前位置:网站首页>@Preauthorize annotation for permission verification
@Preauthorize annotation for permission verification
2022-04-22 12:50:00 【Camellia Inn】
① In the permission table t_policy Two pieces of data are added in :
INSERT INTO `t_policy` VALUES ('fx-policy-fec8332fd0dc12f0000044', 'knowledgeEdit', ' Knowledge base editing ', 'knowledge', ' The knowledge base ', ' Knowledge base editing ', 1, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP());
INSERT INTO `t_policy` VALUES ('fx-policy-fec8332fd0dc12f0000055', 'knowledgeQuery', ' Knowledge base view ', 'knowledge', ' The knowledge base ', ' Knowledge base view ', 1, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP());
② Add permission verification to the method :
@PostMapping("/attachments")
@PreAuthorize("hasAnyAuthority('superAdmin','knowledgeEdit')")
public DocAttachment add(@Valid AttachmentAddReqVo attachmentAddReqVo) {
MultipartFile file = attachmentAddReqVo.getMultipartFile();
// Verify the type and file size of uploaded attachments
String fileType = attachmentTypes.isValid(file);
return docAttachmentService.save(new DocAttachment(attachmentAddReqVo, file, fileType), file);
}
版权声明
本文为[Camellia Inn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221245444446.html
边栏推荐
- R language ggplot2 visualization: calculate the number of missing values of each data column in the dataframe, and visualize the missing values of each data column using a stacked bar plot (set the co
- Let cpolar get a fixed TCP address
- <JDBC> 获取数据库连接的五种方式:你真的get到了吗?
- Express Can‘t set headers after they are sent.问题
- Detailed explanation and code example of serial communication of 51 single chip microcomputer
- Simple deployment of microservices
- Male female pairing
- R language changes dataframe data from long to wide: spread function of tidyr package and pivot of CDATA package_ to_ Rowrecs function, data Table package dcast function
- JS基础9
- 挑选了适合测试边界的汉字及截图
猜你喜欢
随机推荐
Shrinking ox: the last Carnival
.NET宝藏API之:OutputFormatter,格式化输出对象
ABAQUS py command flow of cantilever beam under parabolic pressure
TypeError: connection. connect is not a function
MySQL 5.0安装教程图解详细教程
VR panorama truly restores the driving school environment, and VR live shows the hard power of the driving school
Let cpolar get a fixed TCP address
JS native code to achieve three-level linkage effect
Practice of importing SAS files with R language
Share a recent tag
R language ggplot2 visualization: ggplot2 visualization moves the legend of the image to the inside of the image and customizes the location of the legend
R language changes dataframe data from long to wide: spread function of tidyr package and pivot of CDATA package_ to_ Rowrecs function, data Table package dcast function
智慧文旅逐渐数字化,vr全景推动文旅一体化发展
机器学习7-逻辑斯蒂回归实现西瓜数据集2.0的二分类
Simple deployment of microservices
多线程基础一 线程的创建
购物表格制作
JS基础10
R language ggplot2 visualization: calculate the number of missing values of each data column in the dataframe, and visualize the missing values of each data column using a stacked bar plot (set the co
JS基础8









