From 7bd0b3f5c5fab60d705567a5a06a3b2f57006278 Mon Sep 17 00:00:00 2001 From: Akhilender Bongirwar <112749383+akhilender-bongirwar@users.noreply.github.com> Date: Tue, 23 Apr 2024 02:06:01 +0530 Subject: [PATCH] fix: Fixed permissions for deleting fundraising campaigns (#2256) - Adjusted permissions checks to allow superadmins to delete fundraising campaigns as intended. - Adjusted permissions checks to allow admins of the organization to delete fundraising campaigns as intended. - Ensured no other functionality got affected. - Ensured all the tests are passing succesfully. Signed-off-by: Akhilender --- src/resolvers/Mutation/removeFundraisingCampaign.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolvers/Mutation/removeFundraisingCampaign.ts b/src/resolvers/Mutation/removeFundraisingCampaign.ts index c903d186bd4..7bf5a6083a0 100644 --- a/src/resolvers/Mutation/removeFundraisingCampaign.ts +++ b/src/resolvers/Mutation/removeFundraisingCampaign.ts @@ -115,7 +115,7 @@ export const removeFundraisingCampaign: MutationResolvers["removeFundraisingCamp ); // Checks whether the user is admin of the organization or not. - if (!currentUserIsOrgAdmin || !currentUserAppProfile.isSuperAdmin) { + if (!(currentUserIsOrgAdmin || currentUserAppProfile.isSuperAdmin)) { throw new errors.UnauthorizedError( requestContext.translate(USER_NOT_AUTHORIZED_ERROR.MESSAGE), USER_NOT_AUTHORIZED_ERROR.CODE,