mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 04:32:35 +01:00
Split MANAGE_GUILDS right into MANAGE_GUILDS for instance-wide control and SELF_EDIT_GUILDS for control over guilds you own or have perms to edit
This commit is contained in:
parent
e7b7029244
commit
9886f19d79
@ -44,7 +44,7 @@ router.patch(
|
||||
const rights = await getRights(req.user_id);
|
||||
const permission = await getPermission(req.user_id, guild_id);
|
||||
|
||||
if (!rights.has("MANAGE_GUILDS") || !permission.has("MANAGE_GUILD"))
|
||||
if (!rights.has("SELF_EDIT_GUILDS") || !permission.has("MANAGE_GUILD"))
|
||||
throw DiscordApiErrors.MISSING_PERMISSIONS.withParams(
|
||||
"MANAGE_GUILD",
|
||||
);
|
||||
|
@ -32,7 +32,7 @@ export class Rights extends BitField {
|
||||
static FLAGS = {
|
||||
OPERATOR: BitFlag(0), // has all rights
|
||||
MANAGE_APPLICATIONS: BitFlag(1),
|
||||
MANAGE_GUILDS: BitFlag(2),
|
||||
MANAGE_GUILDS: BitFlag(2), // Manage all guilds instance-wide
|
||||
MANAGE_MESSAGES: BitFlag(3), // Can't see other messages but delete/edit them in channels that they can see
|
||||
MANAGE_RATE_LIMITS: BitFlag(4),
|
||||
MANAGE_ROUTING: BitFlag(5), // can create custom message routes to any channel/guild
|
||||
@ -78,6 +78,7 @@ export class Rights extends BitField {
|
||||
SEND_BACKDATED_EVENTS: BitFlag(42), // can send backdated events
|
||||
USE_MASS_INVITES: BitFlag(43), // added per @xnacly's request — can accept mass invites
|
||||
ACCEPT_INVITES: BitFlag(44), // added per @xnacly's request — can accept user-specific invites and DM requests
|
||||
SELF_EDIT_GUILDS: BitFlag(45), // Edit guilds you own or have permission to edit
|
||||
};
|
||||
|
||||
any(permission: RightResolvable, checkOperator = true) {
|
||||
|
Loading…
Reference in New Issue
Block a user