feat(ai-agent): add permissions for AI Agent management and update related logic

This commit is contained in:
mlogclub
2026-04-23 14:26:10 +08:00
parent 06b9c58e55
commit 155e9173a7
6 changed files with 83 additions and 6 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ func ensureRoles(tx *gorm.DB) (map[string]*models.Role, error) {
now := time.Now()
for _, spec := range constants.Roles {
role := repositories.RoleRepository.FindOne(tx, sqls.NewCnd().Eq("code", spec.Code))
role := repositories.RoleRepository.GetByCode(tx, spec.Code)
if role == nil {
role = &models.Role{
Name: spec.Name,