Trying to get ability filtering down but failing on collections

This commit is contained in:
2012-09-03 23:20:00 -07:00
parent 1e4dcfd9f3
commit 03d99741e5
2 changed files with 15 additions and 10 deletions

View File

@@ -2,8 +2,12 @@ class Ability
include CanCan::Ability
def initialize(user)
can :manage, User do |u|
if user.admin?
can :manage, :all
else
can :read, User do |u|
u.id == user.id
end
end
# Define abilities for the passed in user here. For example:
#