ability.rb revision 813c1fb6ef7f1d386c65abf8d79389be3cb0f4e9
# 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
# Logics
end
can [:destroy, :permissions], Logic do |subject|
end
# Languages
end
can [:destroy, :permissions], Language 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