CanCan: limiting a user's ability to set certain model attributes based on their role

后端 未结 4 1628
耶瑟儿~
耶瑟儿~ 2020-12-29 06:10

I have a Post model with a :published attribute (boolean) and a User model with a role attribute (st

4条回答
  •  离开以前
    2020-12-29 06:38

    So far it is not possible. But according to this: https://github.com/ryanb/cancan/issues/326 this feature should be in cancan 2.0.

    Update: you can see this on CanCan 2.0 branch here: https://github.com/ryanb/cancan/tree/2.0 in section "Resource Attributes"

提交回复
热议问题