首先,让我们定义一个规则:用户只能访问自己创建的文章。facades.Gate.Define("update-post",func(ctxcontext.Context,argumentsmap[string]any)*access.Response{user:=ctx.Value("user").(models.User)post:=arguments["post"].(models.Post)ifuser.ID==post.UserID{returnaccess.NewAllowResponse()}else{returnaccess.NewDenyResponse("error")}})