开发者

Declarative_Athorization: with_permissions_to for all models on single place

Is there a way to have with_permissions_to in a single place globally so that it applies to EVERY fin开发者_如何学Cder method of all models.

Actually, I have very big application and just added this plug-in for authorization. I don't want to use with_permissions_to with every find method for all models.

Thanks, Imran


Try adding:

default_scope { with_permissions_to(:read) }

to your models

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜