teams: editors can't remove the last admin from a team.

This commit is contained in:
Leonard Gram
2019-03-19 14:01:13 +01:00
parent 8593668ab2
commit 21d3d27452
6 changed files with 65 additions and 6 deletions
+1
View File
@@ -10,6 +10,7 @@ var (
ErrTeamNotFound = errors.New("Team not found")
ErrTeamNameTaken = errors.New("Team name is taken")
ErrTeamMemberNotFound = errors.New("Team member not found")
ErrLastTeamAdmin = errors.New("Not allowed to remove last admin")
ErrNotAllowedToUpdateTeam = errors.New("User not allowed to update team")
ErrNotAllowedToUpdateTeamInDifferentOrg = errors.New("User not allowed to update team in another org")
)
+4 -3
View File
@@ -42,9 +42,10 @@ type UpdateTeamMemberCommand struct {
}
type RemoveTeamMemberCommand struct {
OrgId int64 `json:"-"`
UserId int64
TeamId int64
OrgId int64 `json:"-"`
UserId int64
TeamId int64
ProtectLastAdmin bool `json:"-"`
}
// ----------------------