Skip to content

Commit

Permalink
Admins shall manage the festival participation from now
Browse files Browse the repository at this point in the history
  • Loading branch information
kronn committed Feb 13, 2020
1 parent 1edf864 commit f775b8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/models/group/verein.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2019, Schweizer Blasmusikverband. This file is part of
# Copyright (c) 2012-2020, Schweizer Blasmusikverband. This file is part of
# hitobito_sbv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_sbv.
Expand Down Expand Up @@ -104,7 +104,7 @@ def suisa_admins
### ROLES

class Admin < Role::Admin
self.permissions = [:layer_and_below_full]
self.permissions = [:layer_and_below_full, :festival_participation]
end

class Conductor < Role
Expand Down
4 changes: 2 additions & 2 deletions app/models/role/vorstand_praesident.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2019, Schweizer Blasmusikverband. This file is part of
# Copyright (c) 2012-2020, Schweizer Blasmusikverband. This file is part of
# hitobito_sbv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_sbv.
Expand All @@ -18,5 +18,5 @@
#

class Role::VorstandPraesident < Role
self.permissions = [:layer_full, :layer_and_below_read, :contact_data, :festival_participation]
self.permissions = [:layer_full, :layer_and_below_read, :contact_data]
end
24 changes: 16 additions & 8 deletions spec/abilities/group_ability_spec.rb
Expand Up @@ -17,17 +17,17 @@
end

describe 'manage application to festivals' do
context 'as president of a group' do
let(:group_role_class) { Group::VereinVorstand::Praesident }
let(:group) { groups(:vorstand_mg_aarberg)}
context 'as admin of a group' do
let(:group_role_class) { Group::Verein::Admin }
let(:group) { groups(:musikgesellschaft_aarberg) }
let(:checked_group) { groups(:musikgesellschaft_aarberg) }

it { is_expected.to be_able_to(:manage_festival_application, checked_group)}
end

context 'as president of a group' do
let(:group_role_class) { Group::VereinVorstand::Praesident }
let(:group) { groups(:vorstand_mg_aarberg)}
context 'as admin of a group' do
let(:group_role_class) { Group::Verein::Admin }
let(:group) { groups(:musikgesellschaft_aarberg) }
let(:checked_group) { groups(:musikgesellschaft_aarberg) }

it { is_expected.to be_able_to(:manage_festival_application, checked_group)}
Expand All @@ -41,9 +41,17 @@
it { is_expected.to_not be_able_to(:manage_festival_application, checked_group)}
end

context 'as president of a different group' do
context 'as president of a group' do
let(:group_role_class) { Group::VereinVorstand::Praesident }
let(:group) { groups(:vorstand_mg_alterswil)}
let(:group) { groups(:vorstand_mg_aarberg) }
let(:checked_group) { groups(:musikgesellschaft_aarberg) }

it { is_expected.to_not be_able_to(:manage_festival_application, checked_group)}
end

context 'as admin of a different group' do
let(:group_role_class) { Group::Verein::Admin }
let(:group) { groups(:musikgesellschaft_alterswil)}
let(:checked_group) { groups(:musikgesellschaft_aarberg) }

it { is_expected.to_not be_able_to(:manage_festival_application, checked_group)}
Expand Down

0 comments on commit f775b8c

Please sign in to comment.