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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2ca63e37d30027563b26e6c28b7fc79fd2db70199f0ca99943db814d745cec8
|
|
4
|
+
data.tar.gz: 9a3fea3211ed89316963093f7cb5e9de1bf0746f43ad144365b0e42ffd280a9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|