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

@ -38,7 +38,7 @@ func (t *Team) CanUpdate(user *User) bool {
// Check if the current user is in the team and has admin rights in it
exists, _ := x.Where("team_id = ?", t.ID).
And("user_id = ?", user.ID).
And("is_admin = ?", true).
And("admin = ?", true).
Get(&TeamMember{})
return exists
@ -54,7 +54,7 @@ func (t *Team) CanDelete(user *User) bool {
func (t *Team) IsAdmin(user *User) bool {
exists, _ := x.Where("team_id = ?", t.ID).
And("user_id = ?", user.ID).
And("is_admin = ?", true).
And("admin = ?", true).
Get(&TeamMember{})
return exists
}