This commit is contained in:
Yvan
2026-08-17 15:23:57 +08:00
parent 05b49cd86a
commit 083cc3a9ea
24 changed files with 639 additions and 287 deletions
+4 -3
View File
@@ -199,9 +199,10 @@ func (h *API) ApplySync(c *gin.Context) {
httpx.OK(c)
}
func (h *API) FreshCasbin(c *gin.Context) {
// Policies are read from casbin_rule on every authorization decision, so
// there is no in-memory enforcer cache to reload. Keep the compatible
// endpoint and success response.
if err := h.service.FreshCasbin(c.Request.Context()); err != nil {
httpx.Fail(c, "刷新失败")
return
}
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "刷新成功")
}