Not allowing to use team invite links by guest accounts (#12608)
* Not allowing to use team invite links by guest accounts * Adding needed tests * Updating error text
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7ed2ac52a0
Коммит
a6fdb72b19
@@ -499,6 +499,11 @@ func addUserToTeamFromInvite(c *Context, w http.ResponseWriter, r *http.Request)
|
||||
var member *model.TeamMember
|
||||
var err *model.AppError
|
||||
|
||||
if c.App.Session.Props[model.SESSION_PROP_IS_GUEST] == "true" {
|
||||
c.Err = model.NewAppError("addUserToTeamFromInvite", "api.team.add_user_to_team_from_invite.guest.app_error", nil, "", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
if len(tokenId) > 0 {
|
||||
member, err = c.App.AddTeamMemberByToken(c.App.Session.UserId, tokenId)
|
||||
} else if len(inviteId) > 0 {
|
||||
|
||||
Ссылка в новой задаче
Block a user