Extract organiser grant/revoke diffing from Admin::WorkshopsController
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read Admin::WorkshopsController and the existing app/services/ service objects to follow project conventions. Trace create and update, including assign_organisers_or_default and update_workshop_details, then run the existing admin workshop controller specs. Done means role changes behave identically for create/update, including the default-to-chapter-organisers path, and the controller no longer contains role-diffing logic.
由索引模型根据 Issue 内容生成。
描述
Parent: #2938
Problem
Admin::WorkshopsController mutates Member roles directly from private controller methods, on both create (assign_organisers_or_default) and update (update_workshop_details):
def grant_organiser_access(organiser_ids = [])
organiser_ids.each { |id| Member.find(id).add_role(:organiser, @workshop) }
end
def revoke_organiser_access(organiser_ids)
(@workshop.organisers.pluck(:id).map(&:to_s) - organiser_ids).each do |id|
Member.find(id).revoke(:organiser, @workshop)
end
end
Diffing desired vs current organisers and mutating roles is application-layer orchestration, not HTTP coordination.
Proposed change
- Extract the diff + grant/revoke into a service object under
app/services/(follow the existing*_serviceconventions there; naming up to the implementer). - The controller calls it from
create/update; the default-to-chapter-organisers branch moves with it.
Acceptance
Admin::WorkshopsControllerno longer contains role-diffing logic.- Organiser membership changes identically after create/update, including the default-to-chapter-organisers path.
- Existing admin workshop controller specs pass.
- 主要语言
- Ruby
- 星标
- 104
- 派生
- 205
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 77
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codebar/planner 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 56/100
维护者通常 1 天内回复
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash success未关闭bug
难度 3/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
refactoring tech debt
难度 4/5 3-5 天 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 78/100
TheOdinProject/curriculum#31433 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
endoflife-date/endoflife.date#11194 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 84/100