mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 13:55:39 +00:00
Try to inherit permissions from everyoen role on creation (may be wrong)
This commit is contained in:
@@ -60,6 +60,8 @@ router.post(
|
||||
|
||||
if (role_count > maxRoles) throw DiscordApiErrors.MAXIMUM_ROLES.withParams(maxRoles);
|
||||
|
||||
const everyoneRole = await Role.findOne({ where: { id: guild_id } });
|
||||
|
||||
const role = Role.create({
|
||||
// values before ...body are default and can be overridden
|
||||
position: 1,
|
||||
@@ -69,7 +71,7 @@ router.post(
|
||||
...body,
|
||||
guild_id: guild_id,
|
||||
managed: false,
|
||||
permissions: String((req.permission?.bitfield || 0n) & BigInt(body.permissions || "0")),
|
||||
permissions: String((req.permission?.bitfield || 0n) & BigInt(body.permissions || everyoneRole?.permissions || 0)),
|
||||
tags: undefined,
|
||||
icon: undefined,
|
||||
unicode_emoji: undefined,
|
||||
|
||||
Reference in New Issue
Block a user