avo 3.33.1 → 3.33.2
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: 4b9cb8cc08448ac44a60129910cd6b45b327d5f7e04a37bc41246254abcace20
|
|
4
|
+
data.tar.gz: 17dbce5f6bf9f7cbf4ada94144cff41f55c9b70c42b43b16ec07fcc2f253a079
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e5ecd1cedeec3ad78b8b10ba21da2a52d5cc25c34421c6454274c596df19bba9df9fe475353d9e729cff7ce6c94c5351d13366827afa8d327e398480ee02491
|
|
7
|
+
data.tar.gz: a2a28d5e41f7b7ea156557eb572604af2f9711bd1eb51841f9dd3bbb5c3bdd57382453f672d7885eff8a1070849c26104ef091293464a5f096015f2006f63593
|
data/Gemfile.lock
CHANGED
|
@@ -14,6 +14,7 @@ module Avo
|
|
|
14
14
|
before_action :set_attachment_record, only: [:create, :destroy]
|
|
15
15
|
before_action :set_attach_fields, only: [:new, :create]
|
|
16
16
|
before_action :authorize_index_action, only: :index
|
|
17
|
+
before_action :authorize_show_action, only: :show
|
|
17
18
|
before_action :authorize_attach_action, only: [:new, :create]
|
|
18
19
|
before_action :authorize_detach_action, only: :destroy
|
|
19
20
|
|
|
@@ -185,6 +186,11 @@ module Avo
|
|
|
185
186
|
authorize_if_defined "view_#{@field.id}?"
|
|
186
187
|
end
|
|
187
188
|
|
|
189
|
+
def authorize_show_action
|
|
190
|
+
authorize_if_defined "view_#{@field.id}?"
|
|
191
|
+
@related_authorization.set_record(@related_record).authorize_action :show
|
|
192
|
+
end
|
|
193
|
+
|
|
188
194
|
def authorize_attach_action
|
|
189
195
|
authorize_if_defined "attach_#{@field.id}?"
|
|
190
196
|
end
|
|
@@ -150,7 +150,7 @@ module Avo
|
|
|
150
150
|
@related_record = if @field.is_a? Avo::Fields::HasOneField
|
|
151
151
|
@record.send association_name
|
|
152
152
|
else
|
|
153
|
-
@related_resource.find_record params[:related_id], query: @record.send(association_name), params: params
|
|
153
|
+
@related_resource.find_record params[:related_id], query: @related_authorization.apply_policy(@record.send(association_name)), params: params
|
|
154
154
|
end
|
|
155
155
|
@related_resource.hydrate(record: @related_record)
|
|
156
156
|
end
|
|
@@ -12,7 +12,7 @@ module Avo
|
|
|
12
12
|
before_action :detect_fields
|
|
13
13
|
before_action :set_edit_title_and_breadcrumbs, only: [:edit, :update]
|
|
14
14
|
before_action :fill_record, only: [:create, :update]
|
|
15
|
-
#
|
|
15
|
+
# AssociationsController authorizes each of its actions itself, so a new action needs its own check
|
|
16
16
|
before_action :authorize_base_action, except: :preview, if: -> { controller_name != "associations" }
|
|
17
17
|
before_action :set_pagy_locale, only: :index
|
|
18
18
|
|
data/lib/avo/version.rb
CHANGED