Hegwin.Me

Thoughts grows up by feeding itself with its own words.

Rails Authorization with Pundit

Rails权限验证工具Pundit

After people started using Rails 4, `cancan` was criticized for its complexity and lack of compatibility fixes, and people turned to a new tool Pundit. `Pundit` is a pure ruby gem for permission verification. Basic idea: Pundit, for objects that need to be authorized, according to the user's actions, will go to the corresponding policy of this object to find...