action_authorization 0.3.2 → 0.3.3

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: b488de453a34ffee8f9f686af35f9a4221fed24ee7dea3a56475efc295b70f5a
4
- data.tar.gz: 384e891ca0486d7952121c45941eaea65eddae2e40812259da09a373358aba89
3
+ metadata.gz: fb47292dbbc20da84de15b97b546bfe3992c15d76ced260631dd3de722e6ea0d
4
+ data.tar.gz: e832054d9d6c68d969cb1dbe7b5bda50b91fd50f9b3c1b7c88b376275f387f86
5
5
  SHA512:
6
- metadata.gz: 6a2579a9fec0b4115fc9980b535f549fd1b5c31f9ca4180f57d1b7d726d72cb0b78caedd683fca501ffa10ce52e1cf1e873e429cb703e58e2a7d7c3cf57418a0
7
- data.tar.gz: 8c889dc5dd44b874a5d22a9b8b4225b4b5b7c5a8dc01530ac80df8c2fb31830e1115433a2f7d156bb12191430d9e73ddc214d26fe4209d0e88a5b944f776f6a4
6
+ metadata.gz: be44e07c7f4861eb04733f38684ff960236c702e731b4f5d0cd69f46f0f3dc2b8df6d3f25879ee3d1038d72b8c0e465e8c8c48e98212d3bd54a7430d2fe9a393
7
+ data.tar.gz: f17d11f851c42110985e49435174a5f66419e3af3a0341196941036008a14fc45912c55d88cb03bd05ef8c3415de3a5b993b40804471e42efcbd2a19277732fe
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionAuthorization
4
+ class NullPolicy < BasePolicy
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionAuthorization
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.3"
5
5
  end
@@ -4,6 +4,7 @@ require "active_support/core_ext/module/delegation"
4
4
  require "active_support/core_ext/string/inflections"
5
5
  require "action_authorization/version"
6
6
  require "action_authorization/base_policy"
7
+ require "action_authorization/null_policy"
7
8
  require "action_authorization/authorization_failure"
8
9
 
9
10
  module ActionAuthorization
@@ -26,6 +27,6 @@ module ActionAuthorization
26
27
  end
27
28
 
28
29
  def policy_class_for(object)
29
- "#{object.model_name}Policy".constantize
30
+ object.nil? ? NullPolicy : "#{object.model_name}Policy".constantize
30
31
  end
31
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Baldwin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-09-16 00:00:00.000000000 Z
12
+ date: 2024-09-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -39,6 +39,7 @@ files:
39
39
  - lib/action_authorization.rb
40
40
  - lib/action_authorization/authorization_failure.rb
41
41
  - lib/action_authorization/base_policy.rb
42
+ - lib/action_authorization/null_policy.rb
42
43
  - lib/action_authorization/version.rb
43
44
  homepage: https://github.com/wwidea/action_authorization
44
45
  licenses: