1
0

implemented delete team <-> namespace relation

This commit is contained in:
konrad
2018-07-18 08:16:15 +02:00
committed by kolaente
parent 249128a46e
commit ebb5b332b6
3 changed files with 31 additions and 1 deletions

View File

@ -5,3 +5,9 @@ func (tn *TeamNamespace) CanCreate(user *User, _ int64) bool {
n, _ := GetNamespaceByID(tn.NamespaceID)
return n.IsAdmin(user)
}
// CanDelete checks if a user can remove a team from a namespace. Only namespace admins can do that.
func (tn *TeamNamespace) CanDelete(user *User) bool {
n, _ := GetNamespaceByID(tn.NamespaceID)
return n.IsAdmin(user)
}