feat: assign users to teams via OIDC claims #1393
|
@ -82,7 +82,7 @@ type TeamMember struct {
|
|||
}
|
||||
|
||||
// TableName makes beautiful table names
|
||||
func (TeamMember) TableName() string {
|
||||
func (*TeamMember) TableName() string {
|
||||
viehlieb marked this conversation as resolved
Outdated
|
||||
return "team_members"
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ func FindAllOidcTeamIDsForUser(s *xorm.Session, userID int64) (ts []int64, err e
|
|||
Table("team_members").
|
||||
Where("user_id = ? ", userID).
|
||||
Join("RIGHT", "teams", "teams.id = team_members.team_id").
|
||||
viehlieb marked this conversation as resolved
Outdated
konrad
commented
Can Can `teams.oidc_id` be null? Then you should check that as well.
|
||||
Where("teams.oidc_id != ?", "").
|
||||
Where("teams.oidc_id != ? AND teams.oidc_id IS NOT NULL", "").
|
||||
Cols("teams.id").
|
||||
Find(&ts)
|
||||
if ts == nil || err != nil {
|
||||
|
@ -366,11 +366,6 @@ func (t *Team) Create(s *xorm.Session, a web.Auth) (err error) {
|
|||
})
|
||||
}
|
||||
|
||||
func (t *Team) ManageAdminRight(teamMember TeamMember, admin bool) {
|
||||
// Insert the current user as member and admin
|
||||
teamMember.Admin = admin
|
||||
}
|
||||
|
||||
// Delete deletes a team
|
||||
// @Summary Deletes a team
|
||||
// @Description Delets a team. This will also remove the access for all users in that team.
|
||||
|
|
Loading…
Reference in New Issue
Block a user
Why did you change this?
oha.
this was unintended.