我有兩個型號:軌慘慘 - 定義權限嵌套模型
Thread (id, title)
ThreadParticipation (id, thread_id, user_id)
我想定義是這樣的:
can :create, ThreadParticipation if the user is a ThreadParticipation
例如:
for
thread: (1, 'hello world')
thread_participation: (313, 1, 13) -- where 13 is the user_id
我試着:
can :create, ThreadParticipation, :thread_participations => { :user_id => current_user.id }
但那個錯誤。有任何想法嗎?
的財產是它一個非常非常非常非常非常嚴重的錯誤? :D如果沒有一些錯誤信息,很難診斷! – Zabba