对RBAC鉴权模型自定义方法修改 完全支持 RESFTUL模式 支持/:params 占位符模式以及 ?query=地址栏参数模式
This commit is contained in:
@@ -40,3 +40,18 @@ func GetPolicyPathByAuthorityId(c *gin.Context) {
|
||||
paths := new(sysModel.CasbinModel).GetPolicyPathByAuthorityId(cmr.AuthorityId)
|
||||
servers.ReportFormat(c, true, "获取规则成功", gin.H{"paths": paths})
|
||||
}
|
||||
|
||||
// @Tags casbin
|
||||
// @Summary casb RBAC RESTFUL测试路由
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data body api.CreateAuthorityParams true "获取权限列表"
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
// @Router /casbin/CasbinTest [get]
|
||||
func CasbinTest(c *gin.Context) {
|
||||
// 测试restful以及占位符代码 随意书写
|
||||
pathParam := c.Param("pathParam")
|
||||
query := c.Query("query")
|
||||
servers.ReportFormat(c, true, "获取规则成功", gin.H{"pathParam": pathParam, "query": query})
|
||||
}
|
||||
|
Reference in New Issue
Block a user