diff --git a/pkg/internal/server/api/posts_api.go b/pkg/internal/server/api/posts_api.go index 72d08a0..1f8f074 100644 --- a/pkg/internal/server/api/posts_api.go +++ b/pkg/internal/server/api/posts_api.go @@ -38,6 +38,13 @@ func listPost(c *fiber.Ctx) error { realmId := c.QueryInt("realmId", 0) tx := services.FilterPostDraft(database.C) + + if user, authenticated := c.Locals("user").(models.Account); authenticated { + tx = services.FilterPostWithUserContext(tx, &user) + } else { + tx = services.FilterPostWithUserContext(tx, nil) + } + if realmId > 0 { if realm, err := services.GetRealmWithExtID(uint(realmId)); err != nil { return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("realm was not found: %v", err))