Skip to content

Commit

Permalink
Conform to linter and styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
kronn committed Jan 20, 2020
1 parent 91a36b6 commit 41da2ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
6 changes: 1 addition & 5 deletions app/abilities/sbv/role_ability.rb
Expand Up @@ -10,13 +10,9 @@ module RoleAbility
included do
on(Role) do
permission(:group_full).may(:create_history_member).in_same_group

permission(:group_and_below_full).may(:create_history_member).in_same_group_or_below

permission(:layer_full).may(:create_history_member).in_same_layer

permission(:layer_and_below_full).
may(:create_history_member).in_same_layer_or_visible_below
permission(:layer_and_below_full).may(:create_history_member).in_same_layer_or_visible_below

permission(:layer_and_below_full).
may(:create, :create_in_subgroup, :update, :destroy).
Expand Down
12 changes: 5 additions & 7 deletions app/controllers/song_counts_controller.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2018, 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 @@ -26,18 +26,16 @@ def index

private

def redirection_target
end
def redirection_target; end

def verein?
@group.is_a?(Group::Verein)
end

def render_tabular_in_background(format)
target = verein? ? group_concerts_path(@group) : group_song_censuses_path(@group)
with_async_download_cookie(format, export_filename(format), {
redirection_target: target
}) do |filename|
with_async_download_cookie(format, export_filename(format),
redirection_target: target) do |filename|
Export::SongCountsExportJob.new(format,
current_person.id,
parent.id,
Expand All @@ -46,7 +44,7 @@ def render_tabular_in_background(format)
end
end

def export_filename(format)
def export_filename(_format)
str = SongCount.model_name.human
if verein?
str << "-#{@group.name.tr(' ', '_').underscore}"
Expand Down
2 changes: 0 additions & 2 deletions app/jobs/export/song_counts_export_job.rb
@@ -1,5 +1,3 @@
# encoding: utf-8
#
# Copyright (c) 2019, 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
Expand Down
6 changes: 0 additions & 6 deletions app/models/role/musikkommission_praesident.rb
Expand Up @@ -19,12 +19,6 @@
# deleted_at :datetime
#


# Copyright (c) 2012-2013, Puzzle ITC GmbH. This file is part of
# hitobito_generic 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_generic.

class Role::MusikkommissionPraesident < Role
self.permissions = [:layer_read, :group_and_below_full]
end

0 comments on commit 41da2ae

Please sign in to comment.