0

Protector is about controlling models.

How can I deal with controllers #new & #edit actions?

They do not interact with database, but render views that shouldn't be rendered. I should get an error this way.

4

1 回答 1

1

Protector does not work on controller level. However you can use meta methods like can? to evaluate your permission block and get the result even if you don't use models directly.

于 2014-05-07T08:21:17.260 回答