ability.rb revision 1d2a2bdc364ab8fecd3db98c17162ce9f03d4361
7b025f9d9726413eb3f50ca2b39826e7eed816fbJulian Kornberger # Define abilities for the passed in user here.
7b025f9d9726413eb3f50ca2b39826e7eed816fbJulian Kornberger user ||= User.new # guest user (not logged in)
1d2a2bdc364ab8fecd3db98c17162ce9f03d4361Eugen Kuksa can [:update, :destroy, :permissions], Repository do |subject|
f9c64720306a03102ed06e2e497c8f7d5bd0910aChristian Clausen can [:destroy, :permissions], Logic do |subject|
0ae77dd0f6698fa1948d1c6c973cc64d6df9e8d6Christian Clausen can [:destroy, :permissions], LogicMapping do |subject|
0ae77dd0f6698fa1948d1c6c973cc64d6df9e8d6Christian Clausen can [:destroy, :permissions], LanguageMapping do |subject|
ca68055161f6beb2ec248e789ab787e6de69bd18Christian Clausen can [:destroy, :permissions], LogicAdjoint do |subject|
ca68055161f6beb2ec248e789ab787e6de69bd18Christian Clausen can [:destroy, :permissions], LanguageAdjoint do |subject|
813c1fb6ef7f1d386c65abf8d79389be3cb0f4e9Christian Clausen can [:destroy, :permissions], Language do |subject|
8566aec18eff0f0d248d73d2f44f9df16cc41456Julian Kornberger subject.user == user || subject.commentable.permission?(:owner, user)
f4f335875509867dd238df7c92b0b8f4fe101705Julian Kornberger can [:create, :destroy], Metadatum do |subject|
f4f335875509867dd238df7c92b0b8f4fe101705Julian Kornberger subject.user == user || subject.metadatable.permission?(:editor, user)
7b025f9d9726413eb3f50ca2b39826e7eed816fbJulian Kornberger # See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities