MM-9730 & MM-9729: Missing Server PRs (#8908)
* MM-9730: API endpoint to update scheme-derived roles of TeamMembers. * MM-9729: API to update scheme-derived roles of ChannelMembers.
Этот коммит содержится в:
коммит произвёл
Martin Kraft
родитель
2c75247c97
Коммит
0c4078b6b0
@@ -1320,6 +1320,16 @@ func (c *Client4) UpdateTeamMemberRoles(teamId, userId, newRoles string) (bool,
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateTeamMemberSchemeRoles will update the scheme-derived roles on a team for a user.
|
||||
func (c *Client4) UpdateTeamMemberSchemeRoles(teamId string, userId string, schemeRoles *SchemeRoles) (bool, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetTeamMemberRoute(teamId, userId)+"/schemeRoles", schemeRoles.ToJson()); err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateTeam will update a team.
|
||||
func (c *Client4) UpdateTeam(team *Team) (*Team, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetTeamRoute(team.Id), team.ToJson()); err != nil {
|
||||
@@ -1849,6 +1859,16 @@ func (c *Client4) UpdateChannelRoles(channelId, userId, roles string) (bool, *Re
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateChannelMemberSchemeRoles will update the scheme-derived roles on a channel for a user.
|
||||
func (c *Client4) UpdateChannelMemberSchemeRoles(channelId string, userId string, schemeRoles *SchemeRoles) (bool, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetChannelMemberRoute(channelId, userId)+"/schemeRoles", schemeRoles.ToJson()); err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateChannelNotifyProps will update the notification properties on a channel for a user.
|
||||
func (c *Client4) UpdateChannelNotifyProps(channelId, userId string, props map[string]string) (bool, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetChannelMemberRoute(channelId, userId)+"/notify_props", MapToJson(props)); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user