From 20a34c861807d05575b08635d186dbf3608b1427 Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 29 Dec 2020 08:04:13 -0600 Subject: Update permissions check on user subscription tab Previously, it would check your permissions on an ActiveRecord association - which would in most non-admin cases be false, even if they had permissions to manage subscriptions. This changes the check to return a new instance of the users subscriptions, so people with manage subscriptions permissions will still be able to view this tab, while also allowing for you to conditionally allow/deny permissions based on what users subscriptions they are attempting to view. --- app/views/spree/admin/users/_subscription_tab.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/admin/users/_subscription_tab.html.erb b/app/views/spree/admin/users/_subscription_tab.html.erb index cfb9205..4bde827 100644 --- a/app/views/spree/admin/users/_subscription_tab.html.erb +++ b/app/views/spree/admin/users/_subscription_tab.html.erb @@ -1,4 +1,4 @@ -<% if can? :admin, @user.subscriptions %> +<% if can? :admin, SolidusSubscriptions::Subscription.new(user: @user) %> > <%= link_to t("spree.admin.user.subscriptions"), spree.admin_user_subscriptions_path(@user) %> -- cgit v1.2.3