npx skills add https://github.com/chrysaliscat/designgraduation --skill 'Security Guardian'此技能确保应用程序符合 RuoYi 安全模型和通用 Web 安全标准。
@PreAuthorize 注解。场景 : 用户应只能看到自己的购物车或订单。模式 :
// Controller
public TableDataInfo list(AgOrder order) {
// 强制查询按当前用户 ID 进行过滤
order.setUserId(SecurityUtils.getUserId());
startPage();
// ...
}
审计 : 检查是否有任何 select 方法因未设置 userId 而无意中返回了 所有 记录。
场景 : 创建新的 API。模式 :
@PreAuthorize("@ss.hasPermi('agri:order:add')")@PreAuthorize("@ss.hasPermi('agri:order:edit')")@PreAuthorize("@ss.hasPermi('agri:order:list')")
规则 : 首先在菜单/数据库中定义这些权限。规则 :
#{param}(预编译语句)。${param}(字符串拼接),除非绝对必要(例如,动态排序列)并且经过严格净化。在以下情况下调用此技能:
@PreAuthorize)。每周安装量
0
代码仓库
首次出现
1970年1月1日
安全审计
This skill ensures the application complies with the RuoYi Security Model and general Web Security standards.
@PreAuthorize.Context : A user should only see their OWN cart or orders. Pattern :
// Controller
public TableDataInfo list(AgOrder order) {
// FORCE the query to be filtered by current User ID
order.setUserId(SecurityUtils.getUserId());
startPage();
// ...
}
Audit : Check if any select method inadvertently returns all records because userId wasn't set.
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Context : Creating a new API. Pattern :
@PreAuthorize("@ss.hasPermi('agri:order:add')")@PreAuthorize("@ss.hasPermi('agri:order:edit')")@PreAuthorize("@ss.hasPermi('agri:order:list')") Rule : Define these permissions in the Menu/Database first.Rule :
#{param} (Prepared Statement).${param} (String Concatenation) unless absolutely necessary (e.g., dynamic sort columns) and strictly sanitized.Invoke this skill when:
@PreAuthorize).Weekly Installs
0
Repository
First Seen
Jan 1, 1970
Security Audits
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装