Files
mattermost/server/channels/testlib
David KrauserandClaude Opus 4.8 9bc14450ec [MM-69366] Scope property field lookups by object type (#37146)
* [MM-69366] Scope property field lookups by object type

Add GetFieldByNameForObjectType and route the access-control attribute
lookups through it, so a user custom profile attribute is no longer
confused with the internal classification fields that share its name.
Deprecate the name-only GetFieldByName (kept only for the plugin API)
and move internal callers onto the scoped variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Add test store mock expectations for GetFieldByNameForObjectType

The startup migrations now look up fields via the scoped method, so the
testlib mock store needs matching expectations — notably the managed
category field, whose ID is cached at startup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Fix store test to create valid PSAv2 property fields

Setting ObjectType makes a field PSAv2, which requires a valid target
type, so the test fields now use the system target level (with an empty
target ID) instead of an unset target type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 08:17:13 -04:00
..
2023-03-22 17:22:27 -04:00
2023-03-22 17:22:27 -04:00