decidim-verifications-members_picker 0.0.6.1 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/decorators/decidim/user_decorator.rb +31 -33
- data/app/services/decidim/verifications/members_picker/members_picker_authorization_handler.rb +1 -1
- data/config/i18n-tasks.yml +0 -1
- data/config/locales/ca.yml +0 -4
- data/config/locales/en.yml +0 -4
- data/config/locales/es.yml +0 -4
- data/lib/decidim/verifications/members_picker/version.rb +1 -1
- metadata +11 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f11f1c45aae129c15e4618ee7fc854cef1f6a26617181417f263721f8d1d64
|
4
|
+
data.tar.gz: 4d93200d16034cabf66b7dbc2c5f3bba006e7bb188e4812e89fa1691686348bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e76020c68141a5e8b47fb59b874eb94d71ffbb7285b555604d36d86f06d666458c94e3ec5b34e29728e5efa69d238bfec3fe934ad6b431b4f9b3e0f8d6a510d4
|
7
|
+
data.tar.gz: 0b9f220c0951a8e4ded10ab7e1dc5af19e4030cf88567302020e98dd3d608ddd69a4edc02a0db700d50b5a95133321cc623bb7b4fcf70ca4c0dfd9264c8a6904
|
@@ -1,48 +1,46 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module Decidim
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
return unless available_members_picker_authorization?
|
3
|
+
module Decidim::UserDecorator
|
4
|
+
def self.decorate
|
5
|
+
Decidim::User.class_eval do
|
6
|
+
def after_confirmation
|
7
|
+
return unless available_members_picker_authorization?
|
9
8
|
|
10
|
-
|
11
|
-
|
9
|
+
Decidim::Authorization.create_or_update_from(handler)
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def grant_authorization
|
13
|
+
after_confirmation
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
def email_changed?
|
17
|
+
revoke_members_picker_authorization!
|
18
|
+
end
|
20
19
|
|
21
|
-
|
20
|
+
private
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def available_members_picker_authorization?
|
23
|
+
organization.available_authorizations.member?(handler_name)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
def handler_params
|
27
|
+
@handler_params ||= { user: self, members_picker: email }
|
28
|
+
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
def handler_name
|
31
|
+
@handler_name ||= Decidim::Verifications::MembersPicker::MembersPickerAuthorizationHandler.handler_name
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
def handler
|
35
|
+
@handler ||= Decidim::AuthorizationHandler.handler_for(handler_name, handler_params)
|
36
|
+
end
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
def granted_members_picker_authorization
|
39
|
+
Decidim::Authorization.find_by(decidim_user_id: id, name: handler_name)
|
40
|
+
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
end
|
42
|
+
def revoke_members_picker_authorization!
|
43
|
+
granted_members_picker_authorization.destroy! if granted_members_picker_authorization
|
46
44
|
end
|
47
45
|
end
|
48
46
|
end
|
data/config/i18n-tasks.yml
CHANGED
data/config/locales/ca.yml
CHANGED
@@ -9,10 +9,6 @@ ca:
|
|
9
9
|
members_picker_help: "(separats per comes)"
|
10
10
|
name: Tria quins correus electrònics poden participar al component
|
11
11
|
verifications:
|
12
|
-
authorizations:
|
13
|
-
first_login:
|
14
|
-
actions:
|
15
|
-
members_picker_authorization_handler: Elecció de membres
|
16
12
|
members_picker_authorization:
|
17
13
|
extra_explanation: La participació està restringida a només uns participants
|
18
14
|
amb permís.
|
data/config/locales/en.yml
CHANGED
@@ -11,10 +11,6 @@ en:
|
|
11
11
|
name: Pick the emails of the users that will be able to participate in the
|
12
12
|
current component
|
13
13
|
verifications:
|
14
|
-
authorizations:
|
15
|
-
first_login:
|
16
|
-
actions:
|
17
|
-
members_picker_authorization_handler: Members picker
|
18
14
|
members_picker_authorization:
|
19
15
|
extra_explanation: Participation is restricted to participants with the permitted
|
20
16
|
email.
|
data/config/locales/es.yml
CHANGED
@@ -9,10 +9,6 @@ es:
|
|
9
9
|
members_picker_help: "(separado por comas)"
|
10
10
|
name: Elige qué correos electrónicos pueden participar en el componente
|
11
11
|
verifications:
|
12
|
-
authorizations:
|
13
|
-
first_login:
|
14
|
-
actions:
|
15
|
-
members_picker_authorization_handler: Elección de miembros
|
16
12
|
members_picker_authorization:
|
17
13
|
extra_explanation: La participación está restringida a sólo unos participantes
|
18
14
|
con permiso
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-verifications-members_picker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agusti B.R.
|
@@ -16,70 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.28.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.28.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: decidim-verifications
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.28.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: psych
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "<"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '4'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "<"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '4'
|
40
|
+
version: 0.28.0
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: decidim
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
47
|
+
version: 0.28.0
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
54
|
+
version: 0.28.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: decidim-dev
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
59
|
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
61
|
+
version: 0.28.0
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
68
|
+
version: 0.28.0
|
83
69
|
description: The Admin is able to hand-pick which emails are allowed to participate
|
84
70
|
from the component permissions screen.
|
85
71
|
email:
|
@@ -114,14 +100,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
100
|
requirements:
|
115
101
|
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '3.
|
103
|
+
version: '3.1'
|
118
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
105
|
requirements:
|
120
106
|
- - ">="
|
121
107
|
- !ruby/object:Gem::Version
|
122
108
|
version: '0'
|
123
109
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.3.7
|
125
111
|
signing_key:
|
126
112
|
specification_version: 4
|
127
113
|
summary: A decidim-verifications module to restrict which emails can participate in
|