changes admin/valuator permissions

not allowed to create/destroy spending proposals anymore
This commit is contained in:
Juanjo Bazán
2016-03-14 14:35:57 +01:00
parent 89c7459de4
commit decf0f2683
4 changed files with 8 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ module Abilities
can :manage, Annotation
can :manage, SpendingProposal
can [:read, :update], SpendingProposal
end
end
end

View File

@@ -3,7 +3,7 @@ module Abilities
include CanCan::Ability
def initialize(user)
can :manage, SpendingProposal
can [:read, :update, :valuate], SpendingProposal
end
end
end

View File

@@ -52,5 +52,7 @@ describe "Abilities::Administrator" do
it { should be_able_to(:manage, Annotation) }
it { should be_able_to(:manage, SpendingProposal) }
it { should be_able_to(:read, SpendingProposal) }
it { should be_able_to(:update, SpendingProposal) }
it { should be_able_to(:valuate, SpendingProposal) }
end

View File

@@ -6,5 +6,7 @@ describe "Abilities::Valuator" do
let(:user) { valuator.user }
let(:valuator) { create(:valuator) }
it { should be_able_to(:manage, SpendingProposal) }
it { should be_able_to(:read, SpendingProposal) }
it { should be_able_to(:update, SpendingProposal) }
it { should be_able_to(:valuate, SpendingProposal) }
end