diff --git a/pkg/internal/server/api/articles_api.go b/pkg/internal/server/api/articles_api.go index 6e1c341..42027ae 100644 --- a/pkg/internal/server/api/articles_api.go +++ b/pkg/internal/server/api/articles_api.go @@ -2,6 +2,9 @@ package api import ( "fmt" + "strings" + "time" + "git.solsynth.dev/hydrogen/interactive/pkg/internal/database" "git.solsynth.dev/hydrogen/interactive/pkg/internal/gap" "git.solsynth.dev/hydrogen/interactive/pkg/internal/models" @@ -10,8 +13,6 @@ import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" "github.com/samber/lo" - "strings" - "time" ) func getArticle(c *fiber.Ctx) error { @@ -104,7 +105,7 @@ func listDraftArticle(c *fiber.Ctx) error { } func createArticle(c *fiber.Ctx) error { - if err := gap.H.EnsureGrantedPerm(c, "CreateArticle", true); err != nil { + if err := gap.H.EnsureGrantedPerm(c, "CreateArticles", true); err != nil { return err } user := c.Locals("user").(models.Account) diff --git a/pkg/internal/server/api/posts_api.go b/pkg/internal/server/api/posts_api.go index 9bb02ab..187b889 100644 --- a/pkg/internal/server/api/posts_api.go +++ b/pkg/internal/server/api/posts_api.go @@ -2,6 +2,9 @@ package api import ( "fmt" + "strings" + "time" + "git.solsynth.dev/hydrogen/interactive/pkg/internal/database" "git.solsynth.dev/hydrogen/interactive/pkg/internal/gap" "git.solsynth.dev/hydrogen/interactive/pkg/internal/models" @@ -10,8 +13,6 @@ import ( "github.com/gofiber/fiber/v2" "github.com/google/uuid" "github.com/samber/lo" - "strings" - "time" ) func getPost(c *fiber.Ctx) error { @@ -105,7 +106,7 @@ func listDraftPost(c *fiber.Ctx) error { } func createPost(c *fiber.Ctx) error { - if err := gap.H.EnsureGrantedPerm(c, "CreatePost", true); err != nil { + if err := gap.H.EnsureGrantedPerm(c, "CreatePosts", true); err != nil { return err } user := c.Locals("user").(models.Account)