Got abilities working on index; next need to separate users from members from cards.

This commit is contained in:
2012-09-15 18:41:55 -07:00
parent 0bc5858101
commit 93e77b692f
7 changed files with 18 additions and 19 deletions

View File

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