varvet / pundit

Minimal authorization through OO design and pure Ruby classes
MIT License
8.28k stars 629 forks source link

[Request] Generate policy file when using scaffolding #735

Open james-em opened 2 years ago

james-em commented 2 years ago

Hi,

It would be great if running

rails g scaffold Model
rails g controller Model

would actually generate an empty policy file that inherits from ApplicationPolicy.

As a bonus, for resources scaffolding, maybe we could implements all CRUD actions and defaults to false.

james-em commented 2 years ago

Linking this in case it helps the implementation https://gist.github.com/annikoff/331f785aa7a207a7945b1eca6eff526b

Burgestrand commented 11 months ago

FYI this came up again with #785, so I suggested moving that into here.

hoverjet commented 7 months ago

Hi, I've added https://github.com/varvet/pundit/pull/794