isomorfeus-policy 2.2.11 → 2.4.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: 10c40a2764604b4553ad3e0fef7aae5b71c06cdbe4296e22e351158531f81e72
4
- data.tar.gz: 6e6e8db7e4c7e56439282e3e36da86243ab073338fa3825644535768e65592c3
3
+ metadata.gz: 2a4b54c4a738b6b20524ff30e59bfa5f4449bc69eb7dd1bd65bb6765ab1938e2
4
+ data.tar.gz: c55a885dcae902e522ba045b2911833cacce89647b41473d3357210dbce1bac3
5
5
  SHA512:
6
- metadata.gz: d7fb8523a19b2a3263d167054fb069761932e07b251b25689376bac66ab791a13cfb630cad182a27b4489138c640e334f8b177792ffa58a39adeba12807f5512
7
- data.tar.gz: 683a9744b0482e0c28362d5fd325132a7cb894dd720551fe6e8cc67aa31a47de8f5cccd11ee40280246312fcb938f7b3d171e0c2313afe03120925554f4c62f9
6
+ metadata.gz: c9be6398d30ccbc245e9f21dd5c76b46afb82ebef7b5e31ce348919b73ae8b28b97e988aa779db65973f127bbe0a10d945e92eaa66e199fc384514f30b133565
7
+ data.tar.gz: 847e0f1b64120384b88b91774b787e1dbb753ccf91cb560967206043f98e7ad98ad98bfd40bdf2dcf648bef3b75f36a4aadf3d37a202feeed34e573e6b8238b7
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Policy
3
- VERSION = '2.2.11'
3
+ VERSION = '2.4.0'
4
4
  end
5
5
  end
@@ -11,9 +11,6 @@ else
11
11
  require 'isomorfeus_policy/lucid_policy/helper'
12
12
  require 'isomorfeus_policy/lucid_policy/mixin'
13
13
  require 'isomorfeus_policy/lucid_policy/base'
14
- require 'isomorfeus_policy/lucid_authorization/mixin'
15
- require 'isomorfeus_policy/lucid_authorization/base'
16
- require 'isomorfeus_policy/anonymous'
17
14
  require 'iso_opal'
18
15
 
19
16
  Opal.append_path(__dir__.untaint) unless IsoOpal.paths_include?(__dir__.untaint)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.11
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -16,70 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.4.1
19
+ version: 1.5.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: 1.4.1
26
+ version: 1.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: isomorfeus-asset-manager
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.14.17
33
+ version: 0.14.22
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.14.17
40
+ version: 0.14.22
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isomorfeus-preact
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 10.6.56
47
+ version: 10.7.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 10.6.56
54
+ version: 10.7.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: isomorfeus-redux
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 4.1.18
61
+ version: 4.2.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 4.1.18
68
+ version: 4.2.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: isomorfeus
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.2.11
75
+ version: 2.4.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 2.2.11
82
+ version: 2.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -119,9 +119,6 @@ files:
119
119
  - lib/isomorfeus-policy.rb
120
120
  - lib/isomorfeus/policy/config.rb
121
121
  - lib/isomorfeus/policy/version.rb
122
- - lib/isomorfeus_policy/anonymous.rb
123
- - lib/isomorfeus_policy/lucid_authorization/base.rb
124
- - lib/isomorfeus_policy/lucid_authorization/mixin.rb
125
122
  - lib/isomorfeus_policy/lucid_policy/base.rb
126
123
  - lib/isomorfeus_policy/lucid_policy/exception.rb
127
124
  - lib/isomorfeus_policy/lucid_policy/helper.rb
@@ -1,11 +0,0 @@
1
- class Anonymous
2
- include LucidAuthorization::Mixin
3
-
4
- def anonymous?
5
- true
6
- end
7
-
8
- def key
9
- 'anonymous'
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- module LucidAuthorization
2
- class Base
3
- include LucidAuthorization::Mixin
4
- end
5
- end
@@ -1,42 +0,0 @@
1
- module LucidAuthorization
2
- module Mixin
3
- def record_authorization_reason
4
- @_isomorfeus_record_authorization_reason = true
5
- end
6
-
7
- def stop_to_record_authorization_reason
8
- @_isomorfeus_record_authorization_reason = false
9
- @_isomorfeus_authorization_reason = nil
10
- end
11
-
12
- def authorization_reason
13
- @_isomorfeus_authorization_reason
14
- end
15
-
16
- def authorized?(target_class, target_method = nil, props = nil)
17
- begin
18
- class_name = self.class.name
19
- class_name = class_name.split('>::').last if class_name.start_with?('#<')
20
- policy_class = Isomorfeus.cached_policy_class("#{class_name}Policy")
21
- rescue ::NameError
22
- policy_class = nil
23
- end
24
- return false unless policy_class
25
- policy_instance = policy_class.new(self, @_isomorfeus_record_authorization_reason)
26
- result = policy_instance.authorized?(target_class, target_method, props)
27
- @_isomorfeus_authorization_reason = policy_instance.reason
28
- result
29
- end
30
-
31
- def authorized!(target_class, target_method = nil, props = nil)
32
- class_name = self.class.name
33
- class_name = class_name.split('>::').last if class_name.start_with?('#<')
34
- policy_class = Isomorfeus.cached_policy_class("#{class_name}Policy")
35
- Isomorfeus.raise_error(error_class: LucidPolicy::Exception, message: "#{self}: policy class #{class_name}Policy not found!") unless policy_class
36
- policy_instance = policy_class.new(self, @_isomorfeus_record_authorization_reason)
37
- result = policy_instance.authorized!(target_class, target_method, props)
38
- @_isomorfeus_authorization_reason = policy_instance.reason
39
- result
40
- end
41
- end
42
- end