isomorfeus-policy 1.0.0.zeta25 → 2.0.0.rc4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +21 -21
- data/README.md +181 -182
- data/lib/isomorfeus/policy/config.rb +36 -36
- data/lib/isomorfeus/policy/version.rb +5 -5
- data/lib/isomorfeus-policy.rb +22 -21
- data/lib/isomorfeus_policy/anonymous.rb +11 -11
- data/lib/isomorfeus_policy/lucid_authorization/base.rb +5 -5
- data/lib/isomorfeus_policy/lucid_authorization/mixin.rb +42 -42
- data/lib/isomorfeus_policy/lucid_policy/base.rb +10 -11
- data/lib/isomorfeus_policy/lucid_policy/exception.rb +4 -4
- data/lib/isomorfeus_policy/lucid_policy/helper.rb +18 -18
- data/lib/isomorfeus_policy/lucid_policy/mixin.rb +191 -195
- data/lib/lucid_props.rb +95 -95
- metadata +31 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5da9bc50ccb33ff25fba707e6f265fbefd8a5f554fecc1fb987f055490eadfa6
|
4
|
+
data.tar.gz: e2f518ac32f0c21706ca4f4502ae3f3d22bbaa1bfeb688ba94e6317851de980e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a397619a018141c04001dbdf99896cd1ef30a69668aee2f968fe0ff604e9e971dd979b85f2a8c15a195f8b2bf914be301e141a3d7eb5ef43ab2843ae79d5ee1d
|
7
|
+
data.tar.gz: 5543a0d779e2db0030636ee40ceabded794e5627437db6d32bc1de5af4a622546b7d171e6e2401c6a1ddc25676cd39bde27432cfa4e422a067bc18930df3bbe3
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2018 Jan Biedermann
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Jan Biedermann
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,182 +1,181 @@
|
|
1
|
-
# isomorfeus-policy
|
2
|
-
|
3
|
-
Policy for Isomorfeus
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
- `authorized
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
#
|
58
|
-
#
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
|
74
|
-
allow BlaBlaGraph, :member_feature,
|
75
|
-
allow BlaBlaGraph, :member_feature,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
user.authorized?(target_class)
|
90
|
-
user.authorized?(target_class, target_method)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
user.authorized!(target_class)
|
96
|
-
user.authorized!(target_class, target_method)
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
allow if user.
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
Within the
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
If the
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
# this will
|
139
|
-
#
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
# this will
|
144
|
-
#
|
145
|
-
#
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
{
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
```
|
1
|
+
# isomorfeus-policy
|
2
|
+
|
3
|
+
Policy for Isomorfeus
|
4
|
+
|
5
|
+
### Community and Support
|
6
|
+
At the [Isomorfeus Framework Project](http://isomorfeus.com)
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
Policy is enforced on the server, however, the same policy rules are also available on the client to allow for making consistent decisions everywhere.
|
11
|
+
|
12
|
+
Everything that is not explicitly allowed somewhere is denied.
|
13
|
+
|
14
|
+
Place the policy files in your projects `app/policies` directory.
|
15
|
+
|
16
|
+
Any class that would like to authorize for accessing a resource needs to include the `LucidAuthorization::Mixin`
|
17
|
+
or inherit from `LucidAuthorization::Base`. Example:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
class MyUser
|
21
|
+
include LucdiAuthorization::Mixin
|
22
|
+
end
|
23
|
+
```
|
24
|
+
Any instance of that class then has the following methods available:
|
25
|
+
- `authorized?(target_class, method_name, props)` - returning true or false
|
26
|
+
- `authorized!(target_class, method_name, props)` - raising a exception if access is denied, otherwise returning true
|
27
|
+
|
28
|
+
These methods, when called, look for a Policy class. The Policy class must be named after the user class plus the word 'Policy'.
|
29
|
+
Example:
|
30
|
+
|
31
|
+
For a class `MyUser` the policy class must be `MyUserPolicy`.
|
32
|
+
|
33
|
+
### Simple Rules
|
34
|
+
Example Policy:
|
35
|
+
```ruby
|
36
|
+
class MyUserPolicy < LucidPolicy::Base
|
37
|
+
# allow access to all methods of a class
|
38
|
+
allow BlaBlaGraph
|
39
|
+
# class names can be given as strings which benefits autoload performance as the class can be loaded later on
|
40
|
+
allow 'BlaBlaGraph'
|
41
|
+
|
42
|
+
# allow access to all methods of multiple classes
|
43
|
+
allow BlaBlaGraph, BlaComposition
|
44
|
+
|
45
|
+
# allow access to a single method of a class
|
46
|
+
allow BlaBlaGraph, :load
|
47
|
+
|
48
|
+
# or allow multiple methods of a class
|
49
|
+
allow BlaBlaGraph, :load, :save
|
50
|
+
|
51
|
+
# deny access to all methods of multiple classes
|
52
|
+
deny BlaGraph, SuperOperation
|
53
|
+
|
54
|
+
deny others # or: allow others
|
55
|
+
|
56
|
+
# in a otherwise empty policy the following can be used too:
|
57
|
+
# allow all
|
58
|
+
# deny all
|
59
|
+
|
60
|
+
# further conditions can be used
|
61
|
+
allow BlaBlaGraph, :member_feature, only_if: :registered?
|
62
|
+
# this will call the method registered? on the user instance. The method must return a boolean.
|
63
|
+
# permission is granted if the method returned true
|
64
|
+
# method name must be given as symbol
|
65
|
+
# other versions:
|
66
|
+
allow BlaBlaGraph, :member_feature, if: :registered?
|
67
|
+
|
68
|
+
allow BlaBlaGraph, :public_feature, only_if_not: :registered?
|
69
|
+
# this will call the method registered? on the user instance. The method must return a boolean.
|
70
|
+
# permission is granted if the method returned false
|
71
|
+
# method name must be given as symbol
|
72
|
+
# other versions:
|
73
|
+
allow BlaBlaGraph, :member_feature, only_unless: :registered?
|
74
|
+
allow BlaBlaGraph, :member_feature, unless: :registered?
|
75
|
+
allow BlaBlaGraph, :member_feature, if_not: :registered?
|
76
|
+
|
77
|
+
# a proc can be passed directly to a rules condition
|
78
|
+
allow BlaBlaGraph, :member_feature, if: proc { |user, props| user.registered? }
|
79
|
+
# permission is granted if the block returns true
|
80
|
+
|
81
|
+
# similar for deny, though:
|
82
|
+
deny BlaBlaGraph, :member_feature, if: proc { |user, props| !user.registered? }
|
83
|
+
# permission is denied if the block returns true
|
84
|
+
end
|
85
|
+
```
|
86
|
+
and then any of:
|
87
|
+
```ruby
|
88
|
+
user.authorized?(target_class)
|
89
|
+
user.authorized?(target_class, target_method)
|
90
|
+
user.authorized?(target_class, target_method, *props)
|
91
|
+
```
|
92
|
+
or:
|
93
|
+
```ruby
|
94
|
+
user.authorized!(target_class)
|
95
|
+
user.authorized!(target_class, target_method)
|
96
|
+
user.authorized!(target_class, target_method, *props)
|
97
|
+
```
|
98
|
+
which will raise a LucidPolicy::Exception unless authorized
|
99
|
+
|
100
|
+
### Custom Rules
|
101
|
+
Besides calling methods or executing blocks from allow or deny, custom rules can be defined. Example:
|
102
|
+
```ruby
|
103
|
+
class MyUserPolicy < LucidPolicy::Base
|
104
|
+
rule BlaGraph, :load, :count do |user, target_class_name, target_method, props|
|
105
|
+
allow if user.verified?
|
106
|
+
allow if user.admin?
|
107
|
+
deny
|
108
|
+
end
|
109
|
+
end
|
110
|
+
```
|
111
|
+
Within the rule block the `allow` and `deny` methods must be used to allow or deny access.
|
112
|
+
They accept no arguments. Within the block the default is to deny, so any matching allow wins.
|
113
|
+
|
114
|
+
### Combining Policies
|
115
|
+
Policies can be combined. Across policies, the first Policy rule that permits access wins.
|
116
|
+
The outer policy is considered first, then the other policies.
|
117
|
+
If the outer policy allows, then the other policies are not considered.
|
118
|
+
If the outer policy has a `allow all` or a `allow others` rule, then there is a good chance the other policies are never considered.
|
119
|
+
The recommended default rule for combined policies is `deny others`.
|
120
|
+
|
121
|
+
Given a:
|
122
|
+
```ruby
|
123
|
+
class AdminRolePolicy < LucidPolicy::Base
|
124
|
+
rule BlaGraph, :load, :count do |user, target_class_name, target_method, props|
|
125
|
+
allow if user.verified?
|
126
|
+
deny
|
127
|
+
end
|
128
|
+
end
|
129
|
+
```
|
130
|
+
another policy can include the rules. Example:
|
131
|
+
```ruby
|
132
|
+
class MyUserPolicy < LucidPolicy::Base
|
133
|
+
combine_with AdminRolePolicy
|
134
|
+
|
135
|
+
# conditions as for allow and deny can be used too
|
136
|
+
combine_with AdminRolePolicy, if: :admin?
|
137
|
+
# this will call the method admin? on the user instance. The method must return a boolean.
|
138
|
+
# this will execute the AdminRolePolicy rules only if the method returned true
|
139
|
+
# method name must be given as symbol
|
140
|
+
|
141
|
+
combine_with AdminRolePolicy, if_not: :normal_guy?
|
142
|
+
# this will call the method normal_guy?? on the user instance. The method must return a boolean.
|
143
|
+
# this will execute the AdminRolePolicy rules only if the method returned false
|
144
|
+
# method name must be given as symbol
|
145
|
+
# other versions:
|
146
|
+
combine_with AdminRolePolicy, unless: :normal_guy?
|
147
|
+
|
148
|
+
# a block can be passed directly to a rules condition
|
149
|
+
combine_with AdminRolePolicy, if: proc { |user| user.admin? }
|
150
|
+
# this will execute the AdminRolePolicy rules only if the condition block returns true
|
151
|
+
|
152
|
+
deny others
|
153
|
+
end
|
154
|
+
```
|
155
|
+
### Debugging Policies or finding out the winning rule
|
156
|
+
Its possible to start recording the reason for a authorization result:
|
157
|
+
```ruby
|
158
|
+
my_user.record_authorization_reason
|
159
|
+
```
|
160
|
+
When then authorizing:
|
161
|
+
```ruby
|
162
|
+
my_user.authorized?(BlaGraph, :load)
|
163
|
+
```
|
164
|
+
the reason for access or denied access, the winning rule, can be inspected:
|
165
|
+
```ruby
|
166
|
+
my_user.authozation_reason
|
167
|
+
```
|
168
|
+
|
169
|
+
It will be a Hash and show the responsible policy class, condition, condition result, etc. Example:
|
170
|
+
```ruby
|
171
|
+
{ combined:
|
172
|
+
{ class_name: "Resource",
|
173
|
+
others: :deny,
|
174
|
+
policy_class: "CombinedPolicy" },
|
175
|
+
policy_class: "UserPolicy" }
|
176
|
+
```
|
177
|
+
|
178
|
+
Recording can be stopped again, for better performance:
|
179
|
+
```ruby
|
180
|
+
my_user.stop_to_record_authorization_reason
|
181
|
+
```
|
@@ -1,36 +1,36 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
class << self
|
3
|
-
def cached_policy_classes
|
4
|
-
@cached_array_classes ||= {}
|
5
|
-
end
|
6
|
-
|
7
|
-
if RUBY_ENGINE == 'opal'
|
8
|
-
def cached_policy_class(class_name)
|
9
|
-
return "::#{class_name}".constantize if Isomorfeus.development?
|
10
|
-
return cached_policy_classes[class_name] if cached_policy_classes.key?(class_name)
|
11
|
-
cached_policy_classes[class_name] = "::#{class_name}".constantize
|
12
|
-
end
|
13
|
-
else
|
14
|
-
def cached_policy_class(class_name)
|
15
|
-
return nil unless valid_policy_class_name?(class_name)
|
16
|
-
return "::#{class_name}".constantize if Isomorfeus.development?
|
17
|
-
return cached_policy_classes[class_name] if cached_policy_classes.key?(class_name)
|
18
|
-
cached_policy_classes[class_name] = "::#{class_name}".constantize
|
19
|
-
end
|
20
|
-
|
21
|
-
def valid_policy_class_names
|
22
|
-
@valid_policy_class_names ||= Set.new
|
23
|
-
end
|
24
|
-
|
25
|
-
def valid_policy_class_name?(class_name)
|
26
|
-
valid_policy_class_names.include?(class_name)
|
27
|
-
end
|
28
|
-
|
29
|
-
def add_valid_policy_class(klass)
|
30
|
-
class_name = klass.name
|
31
|
-
class_name = class_name.split('>::').last if class_name.start_with?('#<')
|
32
|
-
valid_policy_class_names << class_name
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
1
|
+
module Isomorfeus
|
2
|
+
class << self
|
3
|
+
def cached_policy_classes
|
4
|
+
@cached_array_classes ||= {}
|
5
|
+
end
|
6
|
+
|
7
|
+
if RUBY_ENGINE == 'opal'
|
8
|
+
def cached_policy_class(class_name)
|
9
|
+
return "::#{class_name}".constantize if Isomorfeus.development?
|
10
|
+
return cached_policy_classes[class_name] if cached_policy_classes.key?(class_name)
|
11
|
+
cached_policy_classes[class_name] = "::#{class_name}".constantize
|
12
|
+
end
|
13
|
+
else
|
14
|
+
def cached_policy_class(class_name)
|
15
|
+
return nil unless valid_policy_class_name?(class_name)
|
16
|
+
return "::#{class_name}".constantize if Isomorfeus.development?
|
17
|
+
return cached_policy_classes[class_name] if cached_policy_classes.key?(class_name)
|
18
|
+
cached_policy_classes[class_name] = "::#{class_name}".constantize
|
19
|
+
end
|
20
|
+
|
21
|
+
def valid_policy_class_names
|
22
|
+
@valid_policy_class_names ||= Set.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def valid_policy_class_name?(class_name)
|
26
|
+
valid_policy_class_names.include?(class_name)
|
27
|
+
end
|
28
|
+
|
29
|
+
def add_valid_policy_class(klass)
|
30
|
+
class_name = klass.name
|
31
|
+
class_name = class_name.split('>::').last if class_name.start_with?('#<')
|
32
|
+
valid_policy_class_names << class_name
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Isomorfeus
|
2
|
-
module Policy
|
3
|
-
VERSION = '
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module Isomorfeus
|
2
|
+
module Policy
|
3
|
+
VERSION = '2.0.0.rc4'
|
4
|
+
end
|
5
|
+
end
|
data/lib/isomorfeus-policy.rb
CHANGED
@@ -1,21 +1,22 @@
|
|
1
|
-
require 'isomorfeus-
|
2
|
-
require 'isomorfeus/policy/config'
|
3
|
-
require 'lucid_props'
|
4
|
-
|
5
|
-
if RUBY_ENGINE == 'opal'
|
6
|
-
Isomorfeus.zeitwerk.push_dir('isomorfeus_policy')
|
7
|
-
require_tree 'isomorfeus_policy', :
|
8
|
-
Isomorfeus.zeitwerk.push_dir('policies')
|
9
|
-
else
|
10
|
-
require 'isomorfeus_policy/lucid_policy/exception'
|
11
|
-
require 'isomorfeus_policy/lucid_policy/helper'
|
12
|
-
require 'isomorfeus_policy/lucid_policy/mixin'
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
require 'isomorfeus-preact'
|
2
|
+
require 'isomorfeus/policy/config'
|
3
|
+
require 'lucid_props'
|
4
|
+
|
5
|
+
if RUBY_ENGINE == 'opal'
|
6
|
+
Isomorfeus.zeitwerk.push_dir('isomorfeus_policy')
|
7
|
+
require_tree 'isomorfeus_policy', autoload: true
|
8
|
+
Isomorfeus.zeitwerk.push_dir('policies')
|
9
|
+
else
|
10
|
+
require 'isomorfeus_policy/lucid_policy/exception'
|
11
|
+
require 'isomorfeus_policy/lucid_policy/helper'
|
12
|
+
require 'isomorfeus_policy/lucid_policy/mixin'
|
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
|
+
require 'iso_opal'
|
18
|
+
|
19
|
+
Opal.append_path(__dir__.untaint) unless IsoOpal.paths_include?(__dir__.untaint)
|
20
|
+
path = File.expand_path(File.join('app', 'policies'))
|
21
|
+
Isomorfeus.zeitwerk.push_dir(path) if Dir.exist?(path)
|
22
|
+
end
|
@@ -1,11 +1,11 @@
|
|
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
|
+
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 +1,5 @@
|
|
1
|
-
module LucidAuthorization
|
2
|
-
class Base
|
3
|
-
include LucidAuthorization::Mixin
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module LucidAuthorization
|
2
|
+
class Base
|
3
|
+
include LucidAuthorization::Mixin
|
4
|
+
end
|
5
|
+
end
|