Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEJB: Prevent previous alumni-logic in new groups #147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/group/alumnus_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2017, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Ehemalige
class Group::AlumnusGroup < Group
class Group::AlumnusGroup < JublaGroup
children Group::AlumnusGroup

# Duplicate class attribute to customize it just for AlumnusGroups
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/child_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Kindergruppe
class Group::ChildGroup < Group
class Group::ChildGroup < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:group_full]
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/federal_board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Bundesleitung
class Group::FederalBoard < Group
class Group::FederalBoard < JublaGroup
class Member < Jubla::Role::Member
self.permissions = [:admin, :layer_and_below_full, :contact_data]

Expand Down
2 changes: 1 addition & 1 deletion app/models/group/federation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#

# Ebene Bund
class Group::Federation < Group
class Group::Federation < JublaGroup
self.layer = true
self.default_children = [Group::FederalBoard, Group::OrganizationBoard,
Group::FederalAlumnusGroup]
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/flock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2017, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Ebene Schar
class Group::Flock < Group
class Group::Flock < JublaGroup
include RestrictedRole

self.layer = true
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/kanton_ehemaligenverein.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

# Copyright (c) 2024-2024, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

class Group::KantonEhemaligenverein < ::Group
class Group::KantonEhemaligenverein < NejbGroup
### ROLES

class Leader < ::NejbRole
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/nejb.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

# Copyright (c) 2024-2024, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

class Group::Nejb < ::Group
class Group::Nejb < NejbGroup
self.layer = true
children Group::NejbBundesleitung,
Group::NetzwerkEhemaligeJungwachtBlauring,
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/nejb_bundesleitung.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

# Copyright (c) 2024-2024, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

class Group::NejbBundesleitung < ::Group
class Group::NejbBundesleitung < NejbGroup
class GroupAdmin < ::NejbRole
self.permissions = [:admin, :layer_and_below_full, :contact_data]
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/nejb_kanton.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

# Copyright (c) 2024-2024, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

class Group::NejbKanton < ::Group
class Group::NejbKanton < NejbGroup
children Group::KantonEhemaligenverein, Group::NejbRegion
self.layer = true

Expand Down
2 changes: 1 addition & 1 deletion app/models/group/nejb_region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_jubla.

class Group::NejbRegion < ::Group
class Group::NejbRegion < NejbGroup
children Group::RegionEhemaligenverein, Group::NejbSchar
self.layer = true

Expand Down
4 changes: 2 additions & 2 deletions app/models/group/nejb_schar.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

# Copyright (c) 2024-2024, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

class Group::NejbSchar < ::Group
class Group::NejbSchar < NejbGroup
self.layer = true

### ROLES
Expand Down
65 changes: 65 additions & 0 deletions app/models/group/nejb_simple_group.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# == Schema Information
#
# Table name: groups
#
# id :integer not null, primary key
# parent_id :integer
# lft :integer
# rgt :integer
# name :string(255) not null
# short_name :string(31)
# type :string(255) not null
# email :string(255)
# address :string(1024)
# zip_code :integer
# town :string(255)
# country :string(255)
# contact_id :integer
# created_at :datetime
# updated_at :datetime
# deleted_at :datetime
# layer_group_id :integer
# creator_id :integer
# updater_id :integer
# deleter_id :integer
# require_person_add_requests :boolean default(FALSE), not null
# bank_account :string(255)
# jubla_liability_insurance :boolean default(FALSE), not null
# jubla_full_coverage :boolean default(FALSE), not null
# parish :string(255)
# kind :string(255)
# unsexed :boolean default(FALSE), not null
# clairongarde :boolean default(FALSE), not null
# founding_year :integer
# jubla_property_insurance :boolean default(FALSE), not null
#

# Einfache Gruppe für Alumni, aber ohne Alumni-Magic, kann überall im NEJB-Baum angehängt werden.
class Group::NejbSimpleGroup < NejbGroup
class Leader < NejbRole
self.permissions = [:group_full]
end

class Member < NejbRole
self.permissions = [:group_read]
end

class GroupAdmin < NejbRole
end

class External < NejbRole
self.permissions = []
self.visible_from_above = false
self.kind = :external
end

class DispatchAddress < NejbRole
end

roles Leader, Member, GroupAdmin, External, DispatchAddress
end
4 changes: 2 additions & 2 deletions app/models/group/netzwerk_ehemalige_jungwacht_blauring.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

# Copyright (c) 2024-2024, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

class Group::NetzwerkEhemaligeJungwachtBlauring < ::Group
class Group::NetzwerkEhemaligeJungwachtBlauring < NejbGroup
### ROLES

class Leader < ::NejbRole
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/organization_board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Verbandsleitung
class Group::OrganizationBoard < Group
class Group::OrganizationBoard < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:group_full, :contact_data]
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/group/professional_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#

# Abstract professional group (Fachgruppe)
class Group::ProfessionalGroup < Group
class Group::ProfessionalGroup < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:group_full, :contact_data]
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2017, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Ebene Region
class Group::Region < Group
class Group::Region < JublaGroup
self.layer = true
self.default_children = [Group::RegionalBoard, Group::RegionalAlumnusGroup]

Expand Down
2 changes: 1 addition & 1 deletion app/models/group/region_ehemaligenverein.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_jubla.

class Group::RegionEhemaligenverein < ::Group
class Group::RegionEhemaligenverein < NejbGroup
### ROLES

class Leader < ::NejbRole
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/regional_board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Regionalleitung
class Group::RegionalBoard < Group
class Group::RegionalBoard < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:layer_and_below_full, :contact_data]
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/group/root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_jubla.

class Group::Root < ::Group
class Group::Root < Group
self.layer = true
self.event_types = []

Expand Down
4 changes: 2 additions & 2 deletions app/models/group/simple_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Einfache Gruppe, kann überall angehängt werden.
class Group::SimpleGroup < Group
class Group::SimpleGroup < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:group_full]
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/state.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2017, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.
Expand Down Expand Up @@ -40,7 +40,7 @@
#

# Ebene Kanton
class Group::State < Group
class Group::State < JublaGroup
self.layer = true
self.default_children = [Group::StateAgency, Group::StateBoard, Group::StateAlumnusGroup]
self.contact_group_type = Group::StateAgency
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/state_agency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Arbeitsstelle AST
class Group::StateAgency < Group
class Group::StateAgency < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:layer_and_below_full, :contact_data]
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/state_board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Kantonsvorstand
class Group::StateBoard < Group
class Group::StateBoard < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:group_full, :layer_and_below_read, :contact_data]
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/group/work_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
# jubla_property_insurance :boolean default(FALSE), not null
#

# Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
# Copyright (c) 2012-2024, Jungwacht Blauring Schweiz. This file is part of
# hitobito_jubla 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_jubla.

# Abstract Work Group
class Group::WorkGroup < Group
class Group::WorkGroup < JublaGroup
class Leader < Jubla::Role::Leader
self.permissions = [:group_full, :contact_data]
end
Expand Down
3 changes: 0 additions & 3 deletions app/models/jubla/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ module Jubla::Group

has_many :course_conditions, class_name: "::Event::Course::Condition", dependent: :destroy

# define global children
children Group::SimpleGroup

root_types Group::Root, Group::Federation, Group::Nejb

private
Expand Down
Loading
Loading