Adding ability authorizing in cancan
This commit is contained in:
@@ -2,6 +2,9 @@ class Ability
|
||||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
can :manage, User do |u|
|
||||
u.id == user.id
|
||||
end
|
||||
# Define abilities for the passed in user here. For example:
|
||||
#
|
||||
# user ||= User.new # guest user (not logged in)
|
||||
|
||||
Reference in New Issue
Block a user