jjzjj

AuthorizationNotPerformedError

全部标签

ruby-on-rails - Rails 中的 Pundit::AuthorizationNotPerformedError

什么可能导致verify_authorized方法中出现此错误以及如何解决? 最佳答案 Pundit向您的Controller添加了一个名为verify_authorized的方法,以确保在您的Controller操作中的某处调用了authorize方法。您可能设置了一个调用verify_authorized(https://github.com/elabs/pundit#ensuring-policies-and-scopes-are-used)的after_action。确保通过Controller操作在每个可能的执行路径中调用