ability.rb revision c5fcf21f871b2581eaeef5e225926864fe2b0a26
# Define abilities for the passed in user here.
if user.admin?
can { true }
elsif user.id
# Ontologies
end
can [:destroy, :permissions], Ontology do |subject|
end
# Team permissions
end
# Comments
subject.user == user || subject.commentable.permission?(:owner, user)
end
# TODO tests written?
subject.user == user || subject.metadatable.permission?(:editor, user)
end
end
# See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities
end
end