Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: remove delete action for deleted question even for admin

hgaolbee1f5624e77
diff --git a/internal/service/permission/question_permission.go b/internal/service/permission/question_permission.go
index 1df244e3..b93cdfc1 100644
--- a/internal/service/permission/question_permission.go
+++ b/internal/service/permission/question_permission.go
@@ -92,7 +92,8 @@ func GetQuestionPermission(ctx context.Context, userID string, creatorUserID str
Type: "confirm",
})
}
- if canDelete || userID == creatorUserID {
+
+ if (canDelete || userID == creatorUserID) && status != entity.QuestionStatusDeleted {
actions = append(actions, &schema.PermissionMemberAction{
Action: "delete",
Name: translator.Tr(lang, deleteActionName),