Constraints can be passed directly to your feature class, even easier than you are trying. I am sure that this is lacking in some of the abilities you want to have, but this should make you start. I accept reviews :belong_to Users with foreign key :user_id . It also looks like you need some kind of similar restriction for objects, but you did not have it in the code, so I did not add it to this.
class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user (not logged in) if user.role == "admin" can :manage, :all elsif user.role == "author" can :create, Review can :update, Review, :user_id => user.id can [:show, :update], User, :id => user.id elsif user.role == "owner" can :update, Venue can [:show, :update], User, :id => user.id else can [:show, :update], User, :id => user.id end end end
source share