ability.rb revision f4f335875509867dd238df7c92b0b8f4fe101705
# 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