[pull] master from mattermost:master - #949
Merged
Merged
Conversation
* [MM-70230] Migrate App.GetUser to request context Adds rctx request.CTX as the first parameter of App.GetUser and threads the caller's existing request context through instead of using request.EmptyContext. Updates internal callers across app, api4, and cmd/mmctl to pass their in-scope rctx, and updates the plugin API's GetUser and GetUserCustomStatus implementations to forward the plugin's own request context (PluginAPI.ctx) instead of dropping it. A handful of App methods that previously called GetUser without a context of their own (SessionHasPermissionToUser, ValidateDesktopToken, GenerateMfaSecret, ActivateMfa, DeactivateMfa, UpdateHashedPasswordByUserId, VerifyUserEmail, CreateTermsOfService, GetCustomStatus, and a few private helpers) gained an rctx parameter too, threaded from their own callers. HasPermissionTo is frozen by the public plugin API, so it falls back to request.EmptyContext internally instead. Also removes a few stray unused "context" imports left over from the prior UserStore.Get migration (MM-70222) that were breaking `go build ./...` on master. Part of the MM-56633 store-context campaign. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * [MM-70230] Add request context to App.HasPermissionTo Adds rctx request.CTX as the first parameter of App.HasPermissionTo, letting its internal GetUser call use the real caller context instead of the request.EmptyContext fallback added earlier in this branch. Threads rctx through all internal callers (access_control.go, authorization.go permission wrappers, user.go, slashcommands), which all already had it in scope. The one caller without a request lifecycle (a permission-check closure registered during server bootstrap in server.go) falls back to request.EmptyContext, same as HasPermissionTo itself does for the frozen plugin API. PluginAPI.HasPermissionTo is frozen by the public plugin.API interface, so its signature is unchanged; it now forwards the plugin's own request context (PluginAPI.ctx) instead of dropping it, matching the pattern already used for GetUser and GetUserCustomStatus. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * [MM-70230] Thread request context through getUserFromDB test helper All 13 callers already have th in scope, so passing th.Context is simpler than duplicating the helper's GetUser + require.Nil body at each call site. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * [MM-70230] Reuse the tagged rctx for the user lookup in getSessionExpiredPushMessage The ack_id/session_id/user_id/deviceId/post_id fields the per-session rctx is tagged with were all already available before the getSessionExpiredPushMessage call (set on the two lines above it, or from the loop var/outer msg) -- the rctx was just built after it by ordering, not because of a real dependency. Moving the construction up lets the user lookup and the push send share one correlated, tagged context instead of the lookup using a bare request.EmptyContext. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * [MM-70230] Thread real request context through PermissionChecker The permChecker closure registered in NewServer wasn't actually bootstrap-only: it's invoked later, per-request, from AccessControlAttributeValidationHook.enforceGroupPermissions, which already receives a real rctx from the property service's PreCreatePropertyField/PreUpdatePropertyField(s) hook calls (traced back to c.App.CreatePropertyField(rctx, ...) in api4). The PermissionChecker function type just didn't have a way to carry it, so the closure fell back to request.EmptyContext, discarding context that was available the whole time. Adds rctx request.CTX as PermissionChecker's first parameter and threads it from enforceGroupPermissions's own rctx through to permChecker's call to App.HasPermissionTo. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…8202) Algolia treats all three Docusaurus instances equally, so admin/end-user pages compete with developer and API reference pages. Add optionalFilters on docusaurus_tag so documentation ranks above developers, which ranks above API reference, without excluding any instance from results. Co-authored-by: Cursor <cursoragent@cursor.com>
* [MM-70167] Assign channel attributes at channel creation * Refactor channel attribute assignment tests and improve error handling in channel creation * Improve readability of purgeAttributes function by formatting filter condition * Address review feedback on channel attribute assignment * Add CLASSIFICATIONS_GROUP_NAME constant for access control in classification markings
#38205) * docs: give specialized personas a distinct visual tier on the homepage The SRE, compliance officer, and air-gapped operator links were plain inline text under the four primary persona cards, so they were easy to miss. Add a compact CardGrid variant that renders them as low-weight chips — same surface and hover affordance as the full cards at roughly half the height, so they read as a second tier rather than competing with the primary grid. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: collapse compact CardGrid chips to a list in the PDF build CSS module class names hash to `chip_*`, so the existing `[class*="card"]` print rules don't reach the compact variant and it would keep its web grid layout on paper. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )