summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions
diff options
context:
space:
mode:
authorElia Schito <elia@schito.me>2021-03-11 13:02:52 +0100
committerElia Schito <elia@schito.me>2021-03-11 13:07:55 +0100
commita72dd28a22e38fcded63207cd5a5e3c0a3ebdf9e (patch)
treebaecb1d1c955b37823ac87de0cf9bdfdd6929d6f /lib/solidus_subscriptions
parentf99c56615bc625e4507e73bbc727ec6fd8b70d59 (diff)
Update permitted action names for Solidus v2.11
Under v2.11 :display won't be enough anymore for :show controller actions. The latter needs to be stated explicitly.
Diffstat (limited to 'lib/solidus_subscriptions')
-rw-r--r--lib/solidus_subscriptions/permission_sets/default_customer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/solidus_subscriptions/permission_sets/default_customer.rb b/lib/solidus_subscriptions/permission_sets/default_customer.rb
index ebe888e..1fc42d2 100644
--- a/lib/solidus_subscriptions/permission_sets/default_customer.rb
+++ b/lib/solidus_subscriptions/permission_sets/default_customer.rb
@@ -4,12 +4,12 @@ module SolidusSubscriptions
module PermissionSets
class DefaultCustomer < ::Spree::PermissionSets::Base
def activate!
- can [:display, :update, :skip, :cancel], Subscription, ['user_id = ?', user.id] do |subscription, guest_token|
+ can [:show, :display, :update, :skip, :cancel], Subscription, ['user_id = ?', user.id] do |subscription, guest_token|
(subscription.guest_token.present? && subscription.guest_token == guest_token) ||
(subscription.user && subscription.user == user)
end
- can [:display, :update, :destroy], LineItem do |line_item, guest_token|
+ can [:show, :display, :update, :destroy], LineItem do |line_item, guest_token|
(line_item.subscription&.guest_token.present? && line_item.subscription.guest_token == guest_token) ||
(line_item.subscription&.user && line_item.subscription.user == user)
end