🐛 Fix no perm check on DM

This commit is contained in:
LittleSheep 2025-02-15 15:49:07 +08:00
parent 2228f5054d
commit 406eb9c93b

View File

@ -53,6 +53,10 @@ func createDirectChannel(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("you already have a direct with that user #%d", ch.ID))
}
if err := authkit.EnsureUserPermGranted(gap.Nx, user.ID, relatedUser.ID, "ChannelAdd", true); err != nil {
return fmt.Errorf("unable to add user into your channel due to access denied: %v", err)
}
channel := models.Channel{
Alias: data.Alias,
Name: data.Name,