summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/permission_sets
diff options
context:
space:
mode:
Diffstat (limited to 'lib/solidus_subscriptions/permission_sets')
-rw-r--r--lib/solidus_subscriptions/permission_sets/subscription_management.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/solidus_subscriptions/permission_sets/subscription_management.rb b/lib/solidus_subscriptions/permission_sets/subscription_management.rb
index c669368..9077ab9 100644
--- a/lib/solidus_subscriptions/permission_sets/subscription_management.rb
+++ b/lib/solidus_subscriptions/permission_sets/subscription_management.rb
@@ -4,7 +4,7 @@ module SolidusSubscriptions
module PermissionSets
class SubscriptionManagement < ::Spree::PermissionSets::Base
def activate!
- can :manage, Subscription do |subscription, guest_token|
+ can :manage, Subscription, Subscription.where(user: user) do |subscription, guest_token|
(subscription.guest_token.present? && subscription.guest_token == guest_token) ||
(subscription.user && subscription.user == user)
end