The difference between Banken and Pundit

Masahiro Kyuden edited this page Dec 5, 2015 · 1 revision

In Pundit, to make a Policy class per Model and make the method which corresponds to Action in Controller in a Policy class, the restrictions as 1 to 1 to 1 are born tacitly in Model, Policy, Controller to use Pundit. Basically, it's ArticlesController to handle Article Model, so ArticlePolicy is needed. In this case, Model, Policy, Controller, there are no problems with 1 to 1 to 1. But, Pundit isn't supporting the case when I need more than one Policy to a Model. (For example when both handle the same User Model by Admin::UsersController and UsersController)

In this case, developer has to settle this problem by himself, and it'll come off how to use original Pundit. Therefore there are various problems that upgrade of Pundit and developer's confusion besides you.

Banken doesn't depend on Model, keeping API like Pundit, and a Loyalty class (class of the same role as Policy in Pundit) is made per Controller, so even if an application becomes complicated and a relation of Model and Controller becomes complicated, it's possible to continue the how to use the Banken origin.

(The Scopes of Pundit doesn't exist in Banken. But I'm thinking it's little no problem even if the method which functions equally exists in Model.)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.