Skip to content

Commit 4a89950

Browse files
authored
Merge pull request #520 from LydiaCai1203/fix-model-apikey
fix: model 未判断归属
2 parents d1b7e5c + cfe377d commit 4a89950

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backend/domain/model.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ func (m *Model) From(src *db.Model) *Model {
9595
m.APIKey = ""
9696
return m
9797
}
98+
if src.Edges.User.Role == consts.UserRoleAdmin {
99+
m.Owner = &Owner{
100+
ID: src.Edges.User.ID.String(),
101+
Type: consts.OwnerTypePublic,
102+
Name: consts.MonkeyCodeAITeamName,
103+
}
104+
m.APIKey = ""
105+
return m
106+
}
98107
return m
99108
}
100109

0 commit comments

Comments
 (0)