Skip to content

WPB-23789: Migrate ensureAllowed to type class for Galley/Action - #5087

Merged
blackheaven merged 1 commit into
developfrom
gdifolco/WPB-23789-ensure-allowed
Mar 6, 2026
Merged

WPB-23789: Migrate ensureAllowed to type class for Galley/Action#5087
blackheaven merged 1 commit into
developfrom
gdifolco/WPB-23789-ensure-allowed

Conversation

@blackheaven

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-23789

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@blackheaven
blackheaven requested review from a team as code owners March 4, 2026 20:59
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Mar 4, 2026
@battermann
battermann requested a review from Copilot March 6, 2026 09:19

@battermann battermann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider my comment, otherwise LGTM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to rebase and update the changelog by just appending the PR number here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ensureAllowed as a method on IsConversationAction and implement it per action tag.
  • Update call sites to use the typeclass method (dropping the explicit Sing tag argument).
  • Update internal changelog entry to mention the ensureAllowed migration.

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
blackheaven force-pushed the gdifolco/WPB-23789-ensure-allowed branch from 1eb6d64 to d41ec4a Compare March 6, 2026 19:01
@blackheaven
blackheaven merged commit f331271 into develop Mar 6, 2026
10 checks passed
@blackheaven
blackheaven deleted the gdifolco/WPB-23789-ensure-allowed branch March 6, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants