decidim-verifications-members_picker 0.0.6.1 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2322833c11c71609478a5cc70d38f69c2ceb9b9e5fd6a100e3b8bf42edf3a557
|
4
|
+
data.tar.gz: 4a1b091df13bb29292f57da7e2e2d8f594f14cca8710dd381d72515d95b602a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8059e46887c5815957b92570fb71d8c429206a98e40dcb91ce0cf0de1253690b0f43e79780ccd3772ecff3fbcd6b147929a11ea23b525303782958bf76fba33b
|
7
|
+
data.tar.gz: ba57c6a3098151638072153d0d63f7ad1c9a7f27f36c08736a244bfcc30141807ebcb1e5cec3a5913b7d0f43f8d55beecfa59137f7db09a69ccfc84aeb647d72
|
@@ -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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-verifications-members_picker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agusti B.R.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-core
|
@@ -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
|