WPB-23789: Migrate ensureAllowed to type class for Galley/Action - #5087
Merged
Conversation
battermann
approved these changes
Mar 6, 2026
battermann
left a comment
Contributor
There was a problem hiding this comment.
Please consider my comment, otherwise LGTM
Contributor
There was a problem hiding this comment.
I'd suggest to rebase and update the changelog by just appending the PR number here.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Galley conversation-action authorization by moving ensureAllowed from a tag-dispatch function into the IsConversationAction type class, so each action’s authorization logic lives alongside its performAction implementation.
Changes:
- Add
ensureAllowedas a method onIsConversationActionand implement it per action tag. - Update call sites to use the typeclass method (dropping the explicit
Sing tagargument). - Update internal changelog entry to mention the
ensureAllowedmigration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| services/galley/src/Galley/API/Update.hs | Updates the channel member-removal path to call the new typeclass-based ensureAllowed. |
| services/galley/src/Galley/API/Action.hs | Introduces ensureAllowed as a typeclass method, adds per-action implementations, and updates updateLocalConversationUnchecked to call the method. |
| changelog.d/5-internal/WPB-23789 | Notes the migration of ensureAllowed in the refactoring changelog entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Base automatically changed from
gdifolco/WPB-23789-introduce-type-class
to
develop
March 6, 2026 18:58
blackheaven
force-pushed
the
gdifolco/WPB-23789-ensure-allowed
branch
from
March 6, 2026 19:01
1eb6d64 to
d41ec4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://wearezeta.atlassian.net/browse/WPB-23789
Checklist
changelog.d