1
0

Added method to add a user to a team

This commit is contained in:
konrad
2018-07-26 09:53:32 +02:00
committed by kolaente
parent 0b2f66965a
commit bc580e0115
8 changed files with 66 additions and 8 deletions

View File

@ -0,0 +1,9 @@
package models
func (tm *TeamMember) CanCreate(user *User) bool {
// A user can add a member to a team if he is admin of that team
exists, _ := x.Where("user_id = ? AND team_id = ? AND admin = ?", user.ID, tm.TeamID, true).
Get(&TeamMember{})
return exists
}