MM-60240 Sanitize Channels based on user permissions (#28086)

* initial commit

* add unit tests

* update tests, self review

* update tests to verify something returned.

* update app-layer

* update unit tests

* fix tests

* add check for PermissionSysconsoleReadComplianceDataRetentionPolicy

* revert package-lock

* review suggestions

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Scott Bishel
2024-09-17 15:19:03 -06:00
коммит произвёл GitHub
родитель d99961f106
Коммит c12e6d9e9c
4 изменённых файлов: 147 добавлений и 2 удалений

Просмотреть файл

@@ -356,6 +356,15 @@ func (o *Channel) GetOtherUserIdForDM(userId string) string {
return otherUserId
}
func (o *Channel) Sanitize() Channel {
return Channel{
Id: o.Id,
TeamId: o.TeamId,
Type: o.Type,
DisplayName: o.DisplayName,
}
}
func (t ChannelType) MarshalJSON() ([]byte, error) {
return json.Marshal(string(t))
}