-2

Do I need to define permissions for creating user for guest? I mean can he sign up with out this permissions?

zergood
  • 711
  • 1
  • 10
  • 15

1 Answers1

0

This is relative to what you need, but I would say in most cases you do not set up specific permissions for guest users. Have a look at how Ryan Bates suggest handeling it with CanCan http://railscasts.com/episodes/192-authorization-with-cancan

In effect you could capture it like this in your initialisation of your Ability model:

  def initialize(user)
    user ||= User.new # guest user

    if user.role? :admin
      #admin permissions
    else
      #default permissions
    end
  end
jfvanderwalt
  • 333
  • 2
  • 8