Ent Web UI
Last synchronized at 2026-01-12T22:47:32Z
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.
Devise Example
require 'sidekiq-ent/web'
Sidekiq::Web.authorize do |env,method,path|
session = env['rack.session']
warden_key = session['warden.user.user.key']
return false unless warden_key && warden_key[0] && warden_key[0][0]
user = User.find warden_key[0][0]
user && user.admin?
end
...
Clearance Example
require 'sidekiq-ent/web'
Sidekiq::Web.authorize do |env, method, path|
user = env[:clearance].current_user
user && user.admin?
end
- API
- Active-Job
- Advanced-Options
- Batches
- Best-Practices
- Build-vs-Buy
- Bulk-Queueing
- Comm-Installation
- Commercial-FAQ
- Commercial-Support
- Commercial-collaboration
- Complex-Job-Workflows-with-Batches
- Delayed-extensions
- Deployment
- Devise
- Embedding
- Ent-Encryption
- Ent-Historical-Metrics
- Ent-Leader-Election
- Ent-Multi-Process
- Ent-Periodic-Jobs
- Ent-Rate-Limiting
- Ent-Rolling-Restarts
- Ent-Unique-Jobs
- Ent-Web-UI
- Error-Handling
- FAQ
- Getting-Started
- Heroku
- Home
- Iteration
- Job-Format
- Job-Lifecycle
- Kubernetes
- Logging
- Memory
- Metrics
- Middleware
- Miscellaneous-Features
- Monitoring
- Pro-API
- Pro-Expiring-Jobs
- Pro-Metrics
- Pro-Reliability-Client
- Pro-Reliability-Server
- Pro-Web-UI
- Problems-and-Troubleshooting
- Profiling
- Really-Complex-Workflows-with-Batches
- Related-Projects
- Reliability
- Scaling
- Scheduled-Jobs
- Sharding
- Signals
- Testimonials
- Testing
- The-Basics
- Using-Dragonfly
- Using-Redis