Do I need to define permissions for creating user for guest? I mean can he sign up with out this permissions?
Asked
Active
Viewed 115 times
-2
-
reasonable assumption – apneadiving May 21 '13 at 07:35
-
There are a lot of examles without such guest permissons(cancan official description, railscast #192). But into gem canard description, I have found it. – zergood May 21 '13 at 07:45
1 Answers
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