|
|
@@ -211,6 +211,9 @@ func DeleteModel(ctx *context.Context) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func isCanDelete(ctx *context.Context, model *models.AiModelManage) bool { |
|
|
func isCanDelete(ctx *context.Context, model *models.AiModelManage) bool { |
|
|
|
|
|
if ctx.User == nil { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
if ctx.User.IsAdmin || ctx.User.ID == model.UserId { |
|
|
if ctx.User.IsAdmin || ctx.User.ID == model.UserId { |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
|