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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d99961f106
Коммит
c12e6d9e9c
@@ -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))
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user