From b4be83e3a65497354044898e3548c093f6809b58 Mon Sep 17 00:00:00 2001 From: divyanshumehta Date: Wed, 9 Aug 2017 13:26:38 +0530 Subject: [PATCH] Removed delete action from abiltiy.rb and other places There was no delete action defined for proposals, but it was there in ability.rb So the ability was deleted. Fixes #1608 --- app/models/ability.rb | 2 +- app/models/admin_ability.rb | 2 +- spec/models/ability_spec.rb | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 63ec68dc..6713127c 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -87,7 +87,7 @@ class Ability event.program.cfp_open? && event.new_record? end - can [:update, :show, :delete, :index], Event do |event| + can [:update, :show, :index], Event do |event| event.users.include?(user) end diff --git a/app/models/admin_ability.rb b/app/models/admin_ability.rb index b0c9d4c9..46038d5f 100644 --- a/app/models/admin_ability.rb +++ b/app/models/admin_ability.rb @@ -39,7 +39,7 @@ class AdminAbility event.program.cfp_open? && event.new_record? end - can [:update, :show, :delete, :index], Event do |event| + can [:update, :show, :index], Event do |event| event.users.include?(user) end diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index ff3f14cb..7936ddbb 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -106,7 +106,6 @@ describe 'User' do it{ should be_able_to(:update, user_event_with_cfp) } it{ should be_able_to(:show, user_event_with_cfp) } - it{ should be_able_to(:delete, user_event_with_cfp) } it{ should_not be_able_to(:new, Event.new(program: program_without_cfp)) } it{ should_not be_able_to(:create, Event.new(program: program_without_cfp)) } # TODO: At moment it's not possible to manually add someone else as event_user