Ent Web UI

Anton Mironov edited this page Feb 17, 2017 · 4 revisions

Sidekiq Enterprise 1.5.0+ allows for user-defined authorization within the Web UI; you can define rules for whether a given request is allowed to proceed or not.

Authorization

You define custom authorization logic at the top of your config/routes.rb, like so:

require 'sidekiq-ent/web'

Sidekiq::Web.authorize do |env,method,path|
  # env == the Rack env for this request
  # method == 'GET', 'POST', 'DELETE', etc
  # path == env['PATH_INFO']

  user = nil # you'll need to define how you get access to the current user

  # non-admins only allowed read-only GET operations
  method == 'GET' || user.admin?
end
...

Your authentication library will determine how you get access to the current user. If you use a popular authentication library like Devise, Warden, Sorcery, etc, feel free to update this wiki page with how you access the current user.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.