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 commit9fcc4e67f5. * Revert "Update middleware test" This reverts commit75f767e58d. * 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:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user