Skip to content

Fix admin auth enforcement and agent PATH env#121

Merged
xrendan merged 3 commits intomainfrom
fix/admin-auth-enforcement
Mar 27, 2026
Merged

Fix admin auth enforcement and agent PATH env#121
xrendan merged 3 commits intomainfrom
fix/admin-auth-enforcement

Conversation

@xrendan
Copy link
Copy Markdown
Member

@xrendan xrendan commented Mar 27, 2026

Summary

  • Admin auth: Removed the lambda { |u| u.admin? } check from the Devise authenticate block in routes, and moved the admin enforcement into Avo's authenticate_with block. Non-admins are now redirected to root with a "Not authorized" alert.
  • Agent PATH: Added PATH to the environment passed to the agent subprocess so the Claude CLI binary is discoverable when the job runs.

Test plan

  • Log in as a non-admin user and confirm /admin redirects to root with the alert
  • Log in as an admin user and confirm /admin (Avo) and /admin/good_job (GoodJob) load correctly
  • Trigger AgentEvaluateCommitmentJob and confirm the Claude CLI runs without a PATH-related error

🤖 Generated with Claude Code

xrendan and others added 3 commits March 27, 2026 13:26
- Move admin check from routes into Avo initializer for proper enforcement
- Pass PATH env var to agent subprocess so Claude CLI is found

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chmod 755 ensures the rails user can execute /usr/local/bin/claude
after it's moved from root's home directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@xrendan xrendan merged commit 1e36017 into main Mar 27, 2026
1 of 3 checks passed
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