The CanCan gem offers a straight forward and flexible way to define what a user can and cannot do.
I have just added cancan 1.5.0 to my rails 3 app here is my ability file - def initialize(user) user ||= User.…
ruby-on-rails ruby-on-rails-3 cancanI have a Post model with a :published attribute (boolean) and a User model with a role attribute (string). There …
ruby-on-rails cancanI'm doing: can :manage, :all if user.role == 'admin' can :approve, Anuncio do |anuncio| anuncio.try(:aprovado) == false end My …
ruby-on-rails ruby ruby-on-rails-3 cancan