ae_declarative_authorization 2.1.0 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d3a61732493a7f1dfa8698fa016e257e119204c7bf878397b5caa62080c360b
4
- data.tar.gz: 5d05fbeb9f859e393a42aa86108278037377225ddbe02160a5a6ad5ef4f199fa
3
+ metadata.gz: a2ca63e37d30027563b26e6c28b7fc79fd2db70199f0ca99943db814d745cec8
4
+ data.tar.gz: 9a3fea3211ed89316963093f7cb5e9de1bf0746f43ad144365b0e42ffd280a9d
5
5
  SHA512:
6
- metadata.gz: 01ec7768b90fcdb701456f254519acce547a635cc6b49a0fad4080c41cc3d72901bf6443c44de132a5f10df63d7c7bf866189f8d1f6a3e79a4e11e51bfa92547
7
- data.tar.gz: 7bf88799408d3883d41ecbb5e5616d1d12323e6f2e535c9d39ada2bea149ce349e6696750c57901d0059e930863e0f4b7a4caab2b7c770c683d1c7ac64f1fd91
6
+ metadata.gz: 99a84b5518cd24595e6e411b3cbd59ed30367cd6cd862d3457e7313aa52ff5e85eadaccef200ceb3ecb7b78702399d2bd22642209663cefa6e19ef13ec7d0153
7
+ data.tar.gz: 69916da3d5a336647991102d2e9fa6b17bc9f50cc87999727c1e8b20b174218b0fd747741d45136e10e5aadeb1e71f195e7d0bc48693ef29bbc3a0bef5643237
@@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/reader.rb'
3
3
  require "set"
4
4
  require "forwardable"
5
5
  require 'rails'
6
+ require 'uri'
6
7
 
7
8
  module Authorization
8
9
  # An exception raised if anything goes wrong in the Authorization realm
@@ -218,12 +219,16 @@ module Authorization
218
219
  options[:controller].route&.request_method
219
220
  end
220
221
 
221
- Authorization.config.authorization_denied_callback&.call(
222
+ referer_url = options[:controller]&.respond_to?(:request) ? options[:controller].request&.referer : nil
223
+ referer_path = referer_url ? (URI.parse(referer_url).path rescue nil) : nil
224
+
225
+ Authorization.config.authorization_denied_callback.call(
222
226
  {
223
227
  action: action,
224
228
  path: options[:controller]&.respond_to?(:request) ? options[:controller].request&.path : nil,
225
229
  context: options[:context].to_s,
226
- attribute_check_denial: !rules.empty?
230
+ attribute_check_denial: !rules.empty?,
231
+ referer: referer_path
227
232
  }
228
233
  )
229
234
  end
@@ -1,3 +1,3 @@
1
1
  module DeclarativeAuthorization
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_declarative_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio