⬆️ Follow the permission nodes naming guidelines
This commit is contained in:
parent
93285e3ac1
commit
5b8eff7a42
@ -2,6 +2,9 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.solsynth.dev/hydrogen/interactive/pkg/internal/database"
|
"git.solsynth.dev/hydrogen/interactive/pkg/internal/database"
|
||||||
"git.solsynth.dev/hydrogen/interactive/pkg/internal/gap"
|
"git.solsynth.dev/hydrogen/interactive/pkg/internal/gap"
|
||||||
"git.solsynth.dev/hydrogen/interactive/pkg/internal/models"
|
"git.solsynth.dev/hydrogen/interactive/pkg/internal/models"
|
||||||
@ -10,8 +13,6 @@ import (
|
|||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func getArticle(c *fiber.Ctx) error {
|
func getArticle(c *fiber.Ctx) error {
|
||||||
@ -104,7 +105,7 @@ func listDraftArticle(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createArticle(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
|
return err
|
||||||
}
|
}
|
||||||
user := c.Locals("user").(models.Account)
|
user := c.Locals("user").(models.Account)
|
||||||
|
@ -2,6 +2,9 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.solsynth.dev/hydrogen/interactive/pkg/internal/database"
|
"git.solsynth.dev/hydrogen/interactive/pkg/internal/database"
|
||||||
"git.solsynth.dev/hydrogen/interactive/pkg/internal/gap"
|
"git.solsynth.dev/hydrogen/interactive/pkg/internal/gap"
|
||||||
"git.solsynth.dev/hydrogen/interactive/pkg/internal/models"
|
"git.solsynth.dev/hydrogen/interactive/pkg/internal/models"
|
||||||
@ -10,8 +13,6 @@ import (
|
|||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func getPost(c *fiber.Ctx) error {
|
func getPost(c *fiber.Ctx) error {
|
||||||
@ -105,7 +106,7 @@ func listDraftPost(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createPost(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
|
return err
|
||||||
}
|
}
|
||||||
user := c.Locals("user").(models.Account)
|
user := c.Locals("user").(models.Account)
|
||||||
|
Loading…
Reference in New Issue
Block a user