From aefd99ae9df9a6b95c39cd063955afbf35850c76 Mon Sep 17 00:00:00 2001 From: Yan Victor Date: Tue, 8 Oct 2024 18:32:02 -0300 Subject: [PATCH 1/4] refactor: public access control --- README.md | 1 - manifest.json | 5 ----- src/shared/permissions.ts | 5 ----- src/types/plugin-input.ts | 1 - 4 files changed, 12 deletions(-) diff --git a/README.md b/README.md index 49dc82f..ab8cc52 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Example of valid configuration: - "Priority: 5 (Emergency)" basePriceMultiplier: 1 publicAccessControl: - setLabel: true fundExternalClosedIssue: false ``` diff --git a/manifest.json b/manifest.json index 49a6edc..9080ecc 100644 --- a/manifest.json +++ b/manifest.json @@ -49,17 +49,12 @@ "default": {}, "type": "object", "properties": { - "setLabel": { - "default": false, - "type": "boolean" - }, "fundExternalClosedIssue": { "default": false, "type": "boolean" } }, "required": [ - "setLabel", "fundExternalClosedIssue" ] } diff --git a/src/shared/permissions.ts b/src/shared/permissions.ts index 0a39e1f..e4ff970 100644 --- a/src/shared/permissions.ts +++ b/src/shared/permissions.ts @@ -10,13 +10,8 @@ export async function labelAccessPermissionsCheck(context: Context) { return; } const { logger, payload } = context; - const { publicAccessControl } = context.config; if (!payload.label?.name) return; - if (publicAccessControl.setLabel) { - logger.info("Public access control is enabled for setting labels"); - return true; - } if (payload.sender.type === UserType.Bot) { logger.info("Bot has full control over all labels"); return true; diff --git a/src/types/plugin-input.ts b/src/types/plugin-input.ts index e5c6e46..1f95815 100644 --- a/src/types/plugin-input.ts +++ b/src/types/plugin-input.ts @@ -24,7 +24,6 @@ export const pluginSettingsSchema = T.Object( basePriceMultiplier: T.Number({ default: 1 }), publicAccessControl: T.Object( { - setLabel: T.Boolean({ default: false }), fundExternalClosedIssue: T.Boolean({ default: false }), }, { default: {} } From 37d79c99714eb85579cd19630d8ddd36efa47285 Mon Sep 17 00:00:00 2001 From: Yan Victor Date: Thu, 10 Oct 2024 02:37:31 -0300 Subject: [PATCH 2/4] refactor: public access control to only be a boolean --- README.md | 3 +-- src/types/plugin-input.ts | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ab8cc52..bcef4c7 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,7 @@ Example of valid configuration: - "Priority: 4 (Urgent)" - "Priority: 5 (Emergency)" basePriceMultiplier: 1 - publicAccessControl: - fundExternalClosedIssue: false + fundExternalClosedIssue: false ``` ## Running locally diff --git a/src/types/plugin-input.ts b/src/types/plugin-input.ts index 1f95815..5063eb4 100644 --- a/src/types/plugin-input.ts +++ b/src/types/plugin-input.ts @@ -22,12 +22,7 @@ export const pluginSettingsSchema = T.Object( { default: {} } ), basePriceMultiplier: T.Number({ default: 1 }), - publicAccessControl: T.Object( - { - fundExternalClosedIssue: T.Boolean({ default: false }), - }, - { default: {} } - ), + fundExternalClosedIssue: T.Boolean({ default: false }), }, { default: {} } ); From 13e9a293150fd7b6886a42f0e82897b54ad030b8 Mon Sep 17 00:00:00 2001 From: yhzlsm Date: Fri, 1 Nov 2024 14:45:26 -0300 Subject: [PATCH 3/4] rename variable to fundContributorClosedIssue --- README.md | 2 +- src/types/plugin-input.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bcef4c7..84b090a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Example of valid configuration: - "Priority: 4 (Urgent)" - "Priority: 5 (Emergency)" basePriceMultiplier: 1 - fundExternalClosedIssue: false + fundContributorClosedIssue: false ``` ## Running locally diff --git a/src/types/plugin-input.ts b/src/types/plugin-input.ts index 5063eb4..54a103d 100644 --- a/src/types/plugin-input.ts +++ b/src/types/plugin-input.ts @@ -22,7 +22,7 @@ export const pluginSettingsSchema = T.Object( { default: {} } ), basePriceMultiplier: T.Number({ default: 1 }), - fundExternalClosedIssue: T.Boolean({ default: false }), + fundContributorClosedIssue: T.Boolean({ default: false }), }, { default: {} } ); From af0da72caf7a551933ce359e86bc9ce2b795a391 Mon Sep 17 00:00:00 2001 From: Yan Victor Date: Fri, 1 Nov 2024 15:01:06 -0300 Subject: [PATCH 4/4] refactor variable --- README.md | 2 +- src/types/plugin-input.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bcef4c7..84b090a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Example of valid configuration: - "Priority: 4 (Urgent)" - "Priority: 5 (Emergency)" basePriceMultiplier: 1 - fundExternalClosedIssue: false + fundContributorClosedIssue: false ``` ## Running locally diff --git a/src/types/plugin-input.ts b/src/types/plugin-input.ts index 5063eb4..54a103d 100644 --- a/src/types/plugin-input.ts +++ b/src/types/plugin-input.ts @@ -22,7 +22,7 @@ export const pluginSettingsSchema = T.Object( { default: {} } ), basePriceMultiplier: T.Number({ default: 1 }), - fundExternalClosedIssue: T.Boolean({ default: false }), + fundContributorClosedIssue: T.Boolean({ default: false }), }, { default: {} } );