chadfennell / ccf

codefest
Apache License 2.0
1 stars 1 forks source link

Adding moderator role to edit comments (role vs cancan ability) #37

Closed robertwozniak closed 10 years ago

robertwozniak commented 10 years ago

Just to be clear, its ok to add "Moderator" as an ability using cancan? The gem is there, so I thought I'd ask. Or should "Moderator" be a full fledged role?

pete2786 commented 10 years ago

You can use cancan to authorize the action but you need something to identify the user as a moderator. If you implement the event_moderator model you could check if they are in that table basically, then authorize whatever moderator action they want to perform.