🐛 Fix no perm check on DM
This commit is contained in:
parent
2228f5054d
commit
406eb9c93b
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user