Hello, I'm adding a new menu item in the backend, ...
# support
s
Hello, I'm adding a new menu item in the backend,
Copy code
Spree::Backend::Config.configure do |config|
  # ...
  config.menu_items << config.class::MenuItem.new(
    [:rejected_orders],
    'ban',
    url: '/admin/orders?q[rejected_eq]=true',
    position: 0
  )
end
How only show the menu item after admin login like the others ?
1
k
You can add a
condition
argument, where you can play with authorization to determine who can see that. As it is done here for example: https://github.com/solidusio/solidus/blob/3193519d79fdca44b585872ac6368b5e486eb39d/backend/lib/spree/backend_configuration.rb#L107
🙌 1
s
Nice ! Thank you ;)
👍 1