Skip to content

Commit

Permalink
Merge pull request #20 from hitobito/feature/270
Browse files Browse the repository at this point in the history
  • Loading branch information
codez authored May 23, 2017
2 parents 60c5a95 + 6b225f1 commit 66794b9
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 31 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Hitobito Changelog

## Version 1.15

* [Anpassung von Rollen und Berechtigungen](https://github.com/hitobito/hitobito/issues/270)
32 changes: 17 additions & 15 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ This hitobito wagon defines the organization hierarchy with groups and roles of
* Dachverband
* Administrator/-in: [:admin, :layer_and_below_full]
* Vorstand
* Präsidium: [:layer_and_below_read, :group_and_below_full, :contact_data]
* Finanzverantwortliche/-r: [:layer_and_below_read, :financials, :contact_data]
* Mitglied: [:layer_and_below_read, :contact_data]
* Präsidium: [:layer_read, :group_and_below_full, :contact_data]
* Finanzverantwortliche/-r: [:layer_read, :financials, :contact_data]
* Mitglied: [:layer_read, :contact_data]
* Geschäftsstelle
* Geschäftsleiter/-in: [:layer_and_below_full, :admin, :contact_data]
* Angestellte/-r: [:layer_and_below_full, :admin, :contact_data]
* Finanzverantwortliche/-r: [:layer_and_below_full, :financials, :admin, :contact_data]
* Geschäftsleiter/-in: [:layer_full, :contact_data]
* Angestellte/-r: [:layer_full, :contact_data]
* Finanzverantwortliche/-r: [:layer_full, :financials, :contact_data]
* Gremium
* Leitung: [:layer_and_below_read, :group_and_below_full, :contact_data]
* Mitglied: [:layer_and_below_read]
* Aktive/-r Kursleiter/-in: [:layer_and_below_read]
* Leitung: [:layer_read, :group_and_below_full, :contact_data]
* Mitglied: [:layer_read]
* Aktive/-r Kursleiter/-in: [:layer_read]
* Mitglieder
* Adressverwalter/-in: [:group_and_below_full]
* Mitglied: []
Expand All @@ -37,9 +37,9 @@ This hitobito wagon defines the organization hierarchy with groups and roles of
* Finanzverantwortliche-/r: [:layer_and_below_read, :financials, :contact_data]
* Mitglied: [:layer_and_below_read, :contact_data]
* Geschäftsstelle
* Geschäftsleiter/-in: [:layer_and_below_full, :admin, :contact_data]
* Angestellte/-r: [:layer_and_below_full, :admin, :contact_data]
* Finanzverantwortliche/-r: [:layer_and_below_full, :financials, :admin, :contact_data]
* Geschäftsleiter/-in: [:layer_and_below_full, :contact_data]
* Angestellte/-r: [:layer_and_below_full, :contact_data]
* Finanzverantwortliche/-r: [:layer_and_below_full, :financials, :contact_data]
* Administrator/-in Ortsgruppen: [:layer_and_below_full, :unconfined_below]
* Gremium
* Leitung: [:layer_and_below_read, :group_and_below_full, :contact_data]
Expand All @@ -55,13 +55,15 @@ This hitobito wagon defines the organization hierarchy with groups and roles of
* Spender/-in: []
* Spendenverwalter/-in: [:group_and_below_full]
* Sektion
* Sektion
* Administrator/-in: [:layer_and_below_full, :contact_data]
* Ortsgruppe
* Ortsgruppe
* Administrator/-in Cevi DB: [:layer_and_below_full, :unconfined_below]
* Jungschar
* Jungschar
* Abteilungsleiter/-in: [:layer_and_below_full, :contact_data]
* Coach: [:layer_and_below_read, :approve_applications]
* Coach: [:layer_and_below_full, :approve_applications]
* Finanzverantwortliche/-r: [:layer_and_below_read, :financials]
* Adressverwalter/-in: [:layer_and_below_full]
* Aktuar/-in: [:layer_and_below_read]
Expand Down Expand Up @@ -101,7 +103,7 @@ This hitobito wagon defines the organization hierarchy with groups and roles of
* Teilnehmer/-in: [:group_read]
* Team
* Abteilungsleiter/-in: [:layer_and_below_full, :contact_data]
* Coach: [:layer_and_below_read, :approve_applications]
* Coach: [:layer_and_below_full, :approve_applications]
* Finanzverantwortliche/-r: [:layer_and_below_read, :financials]
* Adressverwalter/-in: [:layer_and_below_full]
* Aktuar/-in: [:layer_and_below_read]
Expand Down Expand Up @@ -162,7 +164,7 @@ This hitobito wagon defines the organization hierarchy with groups and roles of
* Mitglied: [:group_read]
* Freie/-r Mitarbeiter/-in: [:layer_and_below_read]
* Sport Team/Gruppe
* Leiter: [:group_and_below_full]
* Leiter/-in: [:group_and_below_full]
* Mitglied: [:group_read]
* Externe
* Verantwortliche/-r: [:group_and_below_full]
Expand Down
6 changes: 3 additions & 3 deletions app/models/group/dachverband_geschaeftsstelle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class Group::DachverbandGeschaeftsstelle < Group::Geschaeftsstelle
### ROLES

class Geschaeftsleiter < ::Role
self.permissions = [:layer_and_below_full, :admin, :contact_data]
self.permissions = [:layer_full, :contact_data]
end

class Angestellter < ::Role
self.permissions = [:layer_and_below_full, :admin, :contact_data]
self.permissions = [:layer_full, :contact_data]
end

class Finanzverantwortlicher < ::Role
self.permissions = [:layer_and_below_full, :financials, :admin, :contact_data]
self.permissions = [:layer_full, :financials, :contact_data]
end

roles Geschaeftsleiter,
Expand Down
6 changes: 3 additions & 3 deletions app/models/group/dachverband_gremium.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ class Group::DachverbandGremium < Group::Gremium
### ROLES

class Leitung < ::Role
self.permissions = [:layer_and_below_read, :group_and_below_full, :contact_data]
self.permissions = [:layer_read, :group_and_below_full, :contact_data]
end

class Mitglied < ::Role
self.permissions = [:layer_and_below_read]
self.permissions = [:layer_read]
end

class AktiverKursleiter < ::Role
self.permissions = [:layer_and_below_read]
self.permissions = [:layer_read]
end

roles Leitung,
Expand Down
6 changes: 3 additions & 3 deletions app/models/group/dachverband_vorstand.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class Group::DachverbandVorstand < Group::Vorstand
### ROLES

class Praesidium < ::Role
self.permissions = [:layer_and_below_read, :group_and_below_full, :contact_data]
self.permissions = [:layer_read, :group_and_below_full, :contact_data]
end

class Finanzverantwortlicher < ::Role
self.permissions = [:layer_and_below_read, :financials, :contact_data]
self.permissions = [:layer_read, :financials, :contact_data]
end

class Mitglied < ::Role
self.permissions = [:layer_and_below_read, :contact_data]
self.permissions = [:layer_read, :contact_data]
end

roles Praesidium,
Expand Down
2 changes: 1 addition & 1 deletion app/models/group/jungschar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Abteilungsleiter < ::Role
end

class Coach < ::Role
self.permissions = [:layer_and_below_read, :approve_applications]
self.permissions = [:layer_and_below_full, :approve_applications]
end

class Finanzverantwortlicher < ::Role
Expand Down
6 changes: 3 additions & 3 deletions app/models/group/mitgliederorganisation_geschaeftsstelle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class Group::MitgliederorganisationGeschaeftsstelle < Group::Geschaeftsstelle
### ROLES

class Geschaeftsleiter < ::Role
self.permissions = [:layer_and_below_full, :admin, :contact_data]
self.permissions = [:layer_and_below_full, :contact_data]
end

class Angestellter < ::Role
self.permissions = [:layer_and_below_full, :admin, :contact_data]
self.permissions = [:layer_and_below_full, :contact_data]
end

class Finanzverantwortlicher < ::Role
self.permissions = [:layer_and_below_full, :financials, :admin, :contact_data]
self.permissions = [:layer_and_below_full, :financials, :contact_data]
end

class AdminOrtsgruppen < ::Role
Expand Down
10 changes: 9 additions & 1 deletion app/models/group/sektion.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8

# Copyright (c) 2012-2014, CEVI Regionalverband ZH-SH-GL. This file is part of
# Copyright (c) 2012-2017, CEVI Regionalverband ZH-SH-GL. This file is part of
# hitobito_cevi 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_cevi.
Expand Down Expand Up @@ -37,4 +37,12 @@ class Group::Sektion < Group

children Group::Ortsgruppe

### ROLES

class Administrator < ::Role
self.permissions = [:layer_and_below_full, :contact_data]
end

roles Administrator

end
6 changes: 6 additions & 0 deletions config/locales/models.cevi.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ de:
other: Spendenverwalter/-innen
description:

group/sektion/administrator:
one: Administrator/-in
other: Administrator/-innen
description:



group/ortsgruppe/administrator_cevi_db:
one: Administrator/-in Cevi DB
Expand Down
2 changes: 1 addition & 1 deletion spec/abilities/person_ability_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
end

context :layer_and_below_full do
let(:role) { Fabricate(Group::DachverbandGeschaeftsstelle::Geschaeftsleiter.name.to_sym, group: groups(:dachverband_gs)) }
let(:role) { Fabricate(Group::Dachverband::Administrator.name.to_sym, group: groups(:dachverband)) }

it 'may not view any non-visible in lower layers' do
other = Fabricate(Group::Stufe::Teilnehmer.name.to_sym, group: groups(:jungschar_burgd_wildsau))
Expand Down
2 changes: 1 addition & 1 deletion spec/abilities/person_layer_writables_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
subject { accessibles }

context :layer_and_below_full do
let(:role) { Fabricate(Group::DachverbandGeschaeftsstelle::Geschaeftsleiter.name, group: groups(:dachverband_gs)) }
let(:role) { Fabricate(Group::Dachverband::Administrator.name, group: groups(:dachverband)) }

context 'own layer' do
it 'may get people' do
Expand Down

0 comments on commit 66794b9

Please sign in to comment.