summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-07 20:06:09 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-07 20:07:35 +1100
commit67a8c0d445183caa03a1b00b27a799787d28c5f0 (patch)
tree11cd38a1835f90416e085ff9a7fdd6f8fdcd1584
parentfix self_edit_guilds right (diff)
downloadserver-67a8c0d445183caa03a1b00b27a799787d28c5f0.tar.xz
remove self_edit_guilds, was dumb
-rw-r--r--scripts/rights.js1
-rw-r--r--src/api/routes/guilds/#guild_id/index.ts4
-rw-r--r--src/util/entities/Config.ts2
-rw-r--r--src/util/util/Rights.ts1
4 files changed, 3 insertions, 5 deletions
diff --git a/scripts/rights.js b/scripts/rights.js
index d0d1e163..16fb38bc 100644
--- a/scripts/rights.js
+++ b/scripts/rights.js
@@ -7,7 +7,6 @@ console.log(`All rights:`, allRights);
 var discordLike = allRights;
 discordLike -= Rights.FLAGS.OPERATOR;
 discordLike -= Rights.FLAGS.MANAGE_APPLICATIONS;
-discordLike -= Rights.FLAGS.MANAGE_GUILDS;
 discordLike -= Rights.FLAGS.MANAGE_MESSAGES;
 discordLike -= Rights.FLAGS.MANAGE_RATE_LIMITS;
 discordLike -= Rights.FLAGS.MANAGE_ROUTING;
diff --git a/src/api/routes/guilds/#guild_id/index.ts b/src/api/routes/guilds/#guild_id/index.ts
index ca7de430..fb3589cb 100644
--- a/src/api/routes/guilds/#guild_id/index.ts
+++ b/src/api/routes/guilds/#guild_id/index.ts
@@ -44,9 +44,9 @@ router.patch(
 		const rights = await getRights(req.user_id);
 		const permission = await getPermission(req.user_id, guild_id);
 
-		if (!rights.has("SELF_EDIT_GUILDS") && !permission.has("MANAGE_GUILD"))
+		if (!rights.has("MANAGE_GUILDS") && !permission.has("MANAGE_GUILD"))
 			throw DiscordApiErrors.MISSING_PERMISSIONS.withParams(
-				"SELF_EDIT_GUILDS",
+				"MANAGE_GUILDS",
 			);
 
 		var guild = await Guild.findOneOrFail({
diff --git a/src/util/entities/Config.ts b/src/util/entities/Config.ts
index 2b75a049..5035f552 100644
--- a/src/util/entities/Config.ts
+++ b/src/util/entities/Config.ts
@@ -326,7 +326,7 @@ export const DefaultConfigOptions: ConfigValue = {
 		},
 		ipdataApiKey:
 			"eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9",
-		defaultRights: "30644591655936", // See util/scripts/rights.js
+		defaultRights: "30644591655940", // See `npm run generate:rights`
 	},
 	login: {
 		requireCaptcha: false,
diff --git a/src/util/util/Rights.ts b/src/util/util/Rights.ts
index d6e539c0..6ba06d0e 100644
--- a/src/util/util/Rights.ts
+++ b/src/util/util/Rights.ts
@@ -78,7 +78,6 @@ 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) {