API: Minor fix for team creation endpoint when using API key (#18252)

* Fix CreateTeam api endpoint

No team member should be created for requests
authenticated by API tokens.

* Update middleware test

Assert that `isAnonymous` is set for `SignedInUser`
authenticated via API key.

* Add test for team creation

Assert that no team member is created if the signed in user
is anomymous.

* Revert "Fix CreateTeam api endpoint"

This reverts commit 9fcc4e67f5.

* Revert "Update middleware test"

This reverts commit 75f767e58d.

* Fix CreateTeam api endpoint

No team member should be created for requests
authenticated by API tokens.

* Update team test

* Change error to warning and update tests
This commit is contained in:
Sofia Papagiannaki
2019-08-08 11:27:47 +03:00
committed by GitHub
parent f20cd218c0
commit 7520166f17
3 changed files with 97 additions and 8 deletions
+4
View File
@@ -210,6 +210,10 @@ func (user *SignedInUser) HasRole(role RoleType) bool {
return user.OrgRole.Includes(role)
}
func (user *SignedInUser) IsRealUser() bool {
return user.UserId != 0
}
type UserProfileDTO struct {
Id int64 `json:"id"`
Email string `json:"email"`