decidim-department_admin 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63c5991ddf1ec9fea6f3e90c122341f19d02f97d832fbc7bb3635bfdec5f4091
4
- data.tar.gz: f750ada6b119dfd390332c15768a16b48ea6a37536f764cbaeb8962ded46a1ed
3
+ metadata.gz: 7ecc31ae9e41149508bba0d66faec60a5f49874502d1a60440094a792acffcf1
4
+ data.tar.gz: 66805a1eb552135f18a6e60eb801755b2712ac769e9d4209bcbd20bb390456c7
5
5
  SHA512:
6
- metadata.gz: 00574e78d6877feeade71f8c9e70e77f3f49d91b44f378f73db50349c7e1408a0a1f820972fa8b784f44ed2c089345485ec357b54d0749a3113ab2bd88da039a
7
- data.tar.gz: 895bc003e2ad3af6b377c8671054bff0238bb9f32f3d79dce170b982a5b3d0a2b471c352c938a7acfbdba04ff1686552140ee6a8c7e88035b67841f026abffdc
6
+ metadata.gz: 8ac8a0f7d0d1d43f7a2e61044a676dc8c0ef005bb7749742d0e577e4895da8de449ca4d167174bf9ffc9ac26a44d05a36f5f16f3129b030b1d4ebd4a9a3d735e
7
+ data.tar.gz: 2d40480e18d898b50445dd540d2c90fa36a440413b7c6a772a8048af3149153d94acd555d5124d59caf7b3932159869cef54b2ea2b34ba92cdcce818e5aa0b56
@@ -2,32 +2,35 @@
2
2
 
3
3
  module Lib::Decidim::ParticipatorySpaceResourceableDecorator
4
4
  #
5
- # This decorator overrided method to avoid .to_sym error when logged in user is Department Admin
6
- # Override affects only line `case role_name&.to_sym`
7
- # Furthermore added new ParticipatorySpaceRole case for DeparmentAdmin
5
+ # - Add new ParticipatorySpaceRole case for DeparmentAdmin.
6
+ # - Add .to_sym to the `case` test, to avoid error when logged in user is Department Admin
7
+ # This override affects only line `case role_name&.to_sym`
8
8
  #
9
- def self.decorate
10
- Decidim::ParticipatorySpaceResourceable.class_eval do
11
- def user_role_config_for(user, role_name)
12
- case role_name&.to_sym
13
- when :organization_admin
14
- Decidim::ParticipatorySpaceRoleConfig::Admin.new(user)
15
- when :admin # ParticipatorySpace admin
16
- Decidim::ParticipatorySpaceRoleConfig::ParticipatorySpaceAdmin.new(user)
17
- when :department_admin
18
- Decidim::ParticipatorySpaceRoleConfig::DepartmentAdmin.new(user)
19
- when :valuator
20
- Decidim::ParticipatorySpaceRoleConfig::Valuator.new(user)
21
- when :moderator
22
- Decidim::ParticipatorySpaceRoleConfig::Moderator.new(user)
23
- when :collaborator
24
- Decidim::ParticipatorySpaceRoleConfig::Collaborator.new(user)
25
- else
26
- Decidim::ParticipatorySpaceRoleConfig::NullObject.new(user)
27
- end
28
- end
9
+ def user_role_config_for(user, role_name)
10
+ case role_name&.to_sym
11
+ when :organization_admin
12
+ Decidim::ParticipatorySpaceRoleConfig::Admin.new(user)
13
+ when :admin # ParticipatorySpace admin
14
+ Decidim::ParticipatorySpaceRoleConfig::ParticipatorySpaceAdmin.new(user)
15
+ when :department_admin
16
+ Decidim::ParticipatorySpaceRoleConfig::DepartmentAdmin.new(user)
17
+ when :valuator
18
+ Decidim::ParticipatorySpaceRoleConfig::Valuator.new(user)
19
+ when :moderator
20
+ Decidim::ParticipatorySpaceRoleConfig::Moderator.new(user)
21
+ when :collaborator
22
+ Decidim::ParticipatorySpaceRoleConfig::Collaborator.new(user)
23
+ else
24
+ Decidim::ParticipatorySpaceRoleConfig::NullObject.new(user)
29
25
  end
30
26
  end
31
27
  end
32
28
 
33
- Lib::Decidim::ParticipatorySpaceResourceableDecorator.decorate
29
+ require "decidim/assembly"
30
+ Decidim::Assembly.prepend(Lib::Decidim::ParticipatorySpaceResourceableDecorator)
31
+ require "decidim/participatory_process"
32
+ Decidim::ParticipatoryProcess.prepend(Lib::Decidim::ParticipatorySpaceResourceableDecorator)
33
+ if Decidim::DepartmentAdmin.conferences_defined?
34
+ require "decidim/conference"
35
+ Decidim::Conference.prepend(Lib::Decidim::ParticipatorySpaceResourceableDecorator)
36
+ end
@@ -47,6 +47,7 @@ module Decidim
47
47
  # force the concern to be included so that registry is initialized
48
48
  # we choose some random class already including it
49
49
  require "decidim/participatory_processes/admin/categories_controller"
50
+ require "decidim/participatory_processes/admin/components_controller"
50
51
  artifact = ::Decidim::ParticipatoryProcesses::Admin::Concerns::ParticipatoryProcessAdmin
51
52
  ParticipatoryProcessesAdminConcernPermissions = Class.new(::Decidim::DepartmentAdmin::Permissions)
52
53
  register_new_permissions_for(artifact, ParticipatoryProcessesAdminConcernPermissions)
@@ -5,7 +5,7 @@ module Decidim
5
5
  module DepartmentAdmin
6
6
  # see CHANGELOG.md
7
7
  def self.version
8
- "0.8.0"
8
+ "0.8.1"
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-department_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Valls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-13 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin