Skip to content

Commit

Permalink
Allow event leaders to see the layer group of all participants
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame committed Sep 15, 2023
1 parent 6dd53f6 commit 20365db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/domain/pbs/table_displays/people/layer_group_label_column.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2023, Pfadibewegung Schweiz. This file is part of
# hitobito_pbs 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_pbs.

module Pbs::TableDisplays::People
module LayerGroupLabelColumn
protected

def allowed?(object, attr, original_object, original_attr)
# In events, evaluate the permission on the participation, not on the person
ability.can? required_permission(attr), original_object
end
end
end
4 changes: 4 additions & 0 deletions lib/hitobito_pbs/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class Wagon < Rails::Engine

Salutation.prepend Pbs::Salutation

TableDisplays::People::LayerGroupLabelColumn.prepend(
Pbs::TableDisplays::People::LayerGroupLabelColumn
)

### abilities
Ability.store.register Event::ApprovalAbility
AbilityDsl::UserContext::GROUP_PERMISSIONS << :crisis_trigger
Expand Down

0 comments on commit 20365db

Please sign in to comment.