openproject-token 3.0.1 → 4.0.0

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: f959bb6247948bcf6fd18e7f09c798e5b037d1a4d62bf6e1c92781e7e2e5e4e6
4
- data.tar.gz: 9d42841010ef13874b4a3b489c1e96bb750c0650e00a94ed583008623279fbfe
3
+ metadata.gz: 26f34040f3ddbd6546761e8e6e33f5081b95550d3795dccccdf86f3610952b52
4
+ data.tar.gz: d387c8130062a25183db07cbb3f43d7319836d143e3857d5271e24d99ef208eb
5
5
  SHA512:
6
- metadata.gz: a9128f8b0bc9d6cb550dc89c1d085bed523f552f53c44800b3f51819e2b386fe77d2734178bf9c66de8bbd8506de0ee21b32fe7af3362f8bc6916a93eea7ffee
7
- data.tar.gz: 3e3172042fac599e58fb80aaa569adfa697a30713eab643d5f4a085728a725d2e7e8b8561772a778266ee8bb5d3211bb6a46bce80d3987cec1fbc6bdc04d971d
6
+ metadata.gz: 7cfc8e13d23e2d50c5f769ea7482f526b92ecf6a83075ca03790c3415ecf959e073f60f611c217f7546f02b080242d3075cfc32a9185d5e69749c895aa398659
7
+ data.tar.gz: bf8dd5ea2f830eeca4854560f560bcee3ccbbb6993e1d5868bf7caf40c24e0547b454e82b5aa9fde7384ac38314426cb9cac28f838197312596f6dfcf54ccc78
@@ -1,5 +1,5 @@
1
1
  module OpenProject
2
2
  class Token
3
- VERSION = "3.0.1"
3
+ VERSION = "4.0.0"
4
4
  end
5
5
  end
@@ -54,6 +54,7 @@ module OpenProject
54
54
  attr_accessor :reprieve_days
55
55
  attr_accessor :notify_admins_at, :notify_users_at, :block_changes_at
56
56
  attr_accessor :restrictions
57
+ attr_accessor :features
57
58
 
58
59
  validates_presence_of :subscriber
59
60
  validates_presence_of :mail
@@ -91,6 +92,10 @@ module OpenProject
91
92
  self.block_changes_at
92
93
  end
93
94
 
95
+ def has_feature?(name)
96
+ features && features.include?(name.to_sym)
97
+ end
98
+
94
99
  ##
95
100
  # Indicates whether or not the token has expired.
96
101
  #
@@ -168,6 +173,7 @@ module OpenProject
168
173
  hash["block_changes_at"] = self.block_changes_at if self.will_block_changes?
169
174
 
170
175
  hash["restrictions"] = self.restrictions if self.restricted?
176
+ hash["features"] = self.features
171
177
 
172
178
  hash
173
179
  end
@@ -225,6 +231,11 @@ module OpenProject
225
231
  restrictions = Hash[restrictions.map { |k, v| [k.to_sym, v] }]
226
232
  @restrictions = restrictions
227
233
  end
234
+
235
+ features = attributes['features']
236
+ if features && features.is_a?(Array)
237
+ @features = features.map(&:to_sym)
238
+ end
228
239
  end
229
240
 
230
241
  ##
@@ -279,7 +290,6 @@ module OpenProject
279
290
  @domain_required_from_version ||= Gem::Version.new('2.0')
280
291
  end
281
292
 
282
-
283
293
  ##
284
294
  # Reprieve was introduced in version 2.2.0 so could only be set
285
295
  # during generation from then onwards. All tokens before that
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject-token
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenProject GmbH
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-17 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -52,7 +52,21 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.5'
55
- description:
55
+ - !ruby/object:Gem::Dependency
56
+ name: debug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
56
70
  email: info@openproject.com
57
71
  executables: []
58
72
  extensions: []
@@ -69,7 +83,7 @@ homepage: https://www.openproject.org
69
83
  licenses:
70
84
  - GPL-3.0
71
85
  metadata: {}
72
- post_install_message:
86
+ post_install_message:
73
87
  rdoc_options: []
74
88
  require_paths:
75
89
  - lib
@@ -84,8 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
98
  - !ruby/object:Gem::Version
85
99
  version: '0'
86
100
  requirements: []
87
- rubygems_version: 3.3.7
88
- signing_key:
101
+ rubygems_version: 3.4.6
102
+ signing_key:
89
103
  specification_version: 4
90
104
  summary: OpenProject EE token reader
91
105
  test_files: []