Skip to content

HOLD: Allow workshop log owners to edit their logs (waiting for workshop_log refactor)#1363

Draft
maebeale wants to merge 1 commit intomainfrom
maebeale/owner-edit-workshop-log
Draft

HOLD: Allow workshop log owners to edit their logs (waiting for workshop_log refactor)#1363
maebeale wants to merge 1 commit intomainfrom
maebeale/owner-edit-workshop-log

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Mar 8, 2026

What is the goal of this PR and why is this important?

  • Workshop log creators (owners) could not see the Edit button or access the edit form on the index, org show, or show views
  • The edit? policy action was missing from WorkshopLogPolicy, so it fell through to ApplicationPolicy#manage? which is admin-only
  • The update? action already allowed owners, creating an inconsistency

How did you approach the change?

  • Added edit? method to WorkshopLogPolicy with the same admin? || owner? rule as update?
  • No view changes needed — all three views (index, show, org show) already gate the Edit button on allowed_to?(:edit?, log)
  • Added WorkshopLogPolicy spec covering edit? and update? for admin, owner, other user, and anonymous contexts

UI Testing Checklist

  • Log in as a non-admin user who has created a workshop log
  • Verify Edit button appears on workshop logs index
  • Verify Edit button appears on workshop log show page
  • Verify Edit button appears on organization show page (workshop logs section)
  • Verify clicking Edit opens the edit form and saves successfully
  • Verify non-owner, non-admin users do NOT see the Edit button

Anything else to add?

  • The views already had allowed_to?(:edit?, ...) guards — this was purely a policy gap

🤖 Generated with Claude Code

The edit? policy action was not defined in WorkshopLogPolicy, so it
fell through to ApplicationPolicy#manage? (admin-only). Owners could
update via the controller but never saw the Edit button or reached the
edit form. Adding edit? with the same rule as update? fixes this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maebeale maebeale changed the title Allow workshop log owners to edit their logs HOLD: Allow workshop log owners to edit their logs (waiting for workshop_log refactor) Mar 9, 2026
@maebeale maebeale marked this pull request as draft March 9, 2026 16:33
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