bali 6.0.0 → 6.0.1
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/lib/bali/rails/action_controller.rb +11 -8
- data/lib/bali/rails/action_view.rb +8 -5
- data/lib/bali/rails/active_record.rb +7 -4
- data/lib/bali/role.rb +1 -1
- data/lib/bali/statics/active_record.rb +2 -13
- data/lib/bali/statics/record.rb +13 -0
- data/lib/bali/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f2c3170fb8da9fc0a76becddae855901f97cef723cd9db86073e0e2c15d177c
|
4
|
+
data.tar.gz: e9555504164bfb3155d281cfbf4d40629c347d178b76b7eaed2c83caacdcfc4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2241cfc888b7b1c3ea4210c6a0dfc26ba790e8c190631b86d616000fbe4e927bea425f73b1547025c849f9ffc6b01c9f5389129ba9707258c79bf6a31c2c248
|
7
|
+
data.tar.gz: 472f04be142d2e7c42549f2927218c3ca57e880c11c86f2a6d409d0682ea76303299a33f065e070fa8ab38821a408a5ad37507f5d7189210d5baf68c231d4be4
|
@@ -1,14 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
require 'active_support/lazy_load_hooks'
|
4
5
|
|
5
|
-
ActiveSupport.on_load :action_controller do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
ActiveSupport.on_load :action_controller do
|
7
|
+
require "bali"
|
8
|
+
::ActionController::Base.send :include, Bali::Statics::Authorizer
|
9
|
+
::ActionController::Base.send :include, Bali::Statics::ScopeRuler
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
if defined? ::ActionController::API
|
12
|
+
::ActionController::API.send :include, Bali::Statics::Authorizer
|
13
|
+
::ActionController::API.send :include, Bali::Statics::ScopeRuler
|
14
|
+
end
|
13
15
|
end
|
16
|
+
rescue LoadError
|
14
17
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
require 'active_support/lazy_load_hooks'
|
4
5
|
|
5
|
-
ActiveSupport.on_load :action_view do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
ActiveSupport.on_load :action_view do
|
7
|
+
require "bali"
|
8
|
+
::ActionView::Base.send :include, Bali::Statics::Authorizer
|
9
|
+
::ActionView::Base.send :include, Bali::Statics::ScopeRuler
|
10
|
+
end
|
11
|
+
rescue LoadError
|
9
12
|
end
|
@@ -1,8 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
require 'active_support/lazy_load_hooks'
|
4
5
|
|
5
|
-
ActiveSupport.on_load :active_record do
|
6
|
-
|
7
|
-
|
6
|
+
ActiveSupport.on_load :active_record do
|
7
|
+
require "bali"
|
8
|
+
::ActiveRecord::Base.send :extend, Bali::Statics::Record
|
9
|
+
end
|
10
|
+
rescue LoadError
|
8
11
|
end
|
data/lib/bali/role.rb
CHANGED
@@ -1,13 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
cls.class_eval do
|
4
|
-
class << self
|
5
|
-
attr_accessor :role_field_for_authorization
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.extract_roles_from method_name
|
9
|
-
@role_field_for_authorization = method_name
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
# This class is deprecated. Please use Bali::Statics::Record instead of this.
|
2
|
+
Bali::Statics::ActiveRecord = Bali::Statics::Record
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Bali::Statics::Record
|
2
|
+
def self.extended(cls)
|
3
|
+
cls.class_eval do
|
4
|
+
class << self
|
5
|
+
attr_accessor :role_field_for_authorization
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.extract_roles_from method_name
|
9
|
+
@role_field_for_authorization = method_name
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/bali/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bali
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Notodikromo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- lib/bali/rules.rb
|
167
167
|
- lib/bali/statics/active_record.rb
|
168
168
|
- lib/bali/statics/authorizer.rb
|
169
|
+
- lib/bali/statics/record.rb
|
169
170
|
- lib/bali/statics/scope_ruler.rb
|
170
171
|
- lib/bali/tasks/bali/print_rules.rake
|
171
172
|
- lib/bali/version.rb
|