Skip to content

feat: add configurable Horizon dashboard admin access#9354

Open
SelimSalihovic wants to merge 1 commit intocoollabsio:nextfrom
SelimSalihovic:feature/horizon-configurable-admin-access
Open

feat: add configurable Horizon dashboard admin access#9354
SelimSalihovic wants to merge 1 commit intocoollabsio:nextfrom
SelimSalihovic:feature/horizon-configurable-admin-access

Conversation

@SelimSalihovic
Copy link
Copy Markdown

Changes

Added support for HORIZON_ALLOWED_EMAILS environment variable to allow multiple users to access the Horizon dashboard. Previously, only the root user (User ID 0) could access /horizon. This change modifies the HorizonServiceProvider gate to check for a comma-separated list of email addresses in the new environment variable. Root user always retains access for backward compatibility.

Modified files:

  • app/Providers/HorizonServiceProvider.php - Updated gate logic to check HORIZON_ALLOWED_EMAILS
  • .env.development.example - Added documentation for new environment variable

Issues

Category

  • New feature

Preview

Testing was performed in local development environment. Screenshots can be provided upon request showing non-root user accessing Horizon dashboard after setting HORIZON_ALLOWED_EMAILS.

AI Assistance

  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: AI assisted with implementation and PR creation. Code was reviewed and tested by human contributor.

Testing

Tested in local development environment:

  1. Started development environment with spin up
  2. Added HORIZON_ALLOWED_EMAILS=test@example.com to .env file
  3. Restarted Horizon with: docker exec coolify php artisan horizon:terminate
  4. Verified root user can access /horizon
  5. Verified user in HORIZON_ALLOWED_EMAILS can access /horizon
  6. Verified unauthorized user gets 403 Forbidden
  7. Verified backward compatibility by removing env var - only root user retained access

Contributor Agreement

Important

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn't a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

Add HORIZON_ALLOWED_EMAILS env var to grant additional users access to
the Horizon dashboard. Root user (User ID 0) always retains access.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant