summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Deere <brendan@stembolt.com>2017-07-24 16:12:21 -0700
committerBrendan Deere <brendan@stembolt.com>2017-07-24 16:21:31 -0700
commitedb9c51a8773cc911c51cf23380e26c2c3170b24 (patch)
treed09be858a57aada800a826b0d8a149d433c695b1
parent9b20aaa10673197b54c626978e3fe0aa03688dac (diff)
Authorize subscriptions admin sidebar link
Only show the admin sidebar link if the user is authorized to see it. Before: The link to the subscriptions area of the subscriptions administrative area would be displayed on the admin login screen. Clicking this link without authenticating would redirect the user to the log in page After: The link to the subscriptions area of the admin is hidden until after the user authenticates
-rw-r--r--lib/solidus_subscriptions/engine.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/solidus_subscriptions/engine.rb b/lib/solidus_subscriptions/engine.rb
index 37c34e5..822f9b2 100644
--- a/lib/solidus_subscriptions/engine.rb
+++ b/lib/solidus_subscriptions/engine.rb
@@ -33,7 +33,8 @@ module SolidusSubscriptions
config.menu_items << config.class::MenuItem.new(
[:subscriptions],
'repeat',
- url: :admin_subscriptions_path
+ url: :admin_subscriptions_path,
+ condition: ->{ can?(:admin, SolidusSubscriptions::Subscription) }
)
end
end