From f9ab95559c8dd806a0bf089c0207c41aa92deb94 Mon Sep 17 00:00:00 2001
From: Happyesss <22csaiml002@jssaten.ac.in>
Date: Fri, 29 May 2026 12:38:46 +0530
Subject: [PATCH 1/2] feat: enhance GitHub integration with project permissions
and update repository connection logic fix: improve project members filtering
and prevent unauthorized access to repository actions refactor: streamline
password history management in authentication flow fix: reset attachment
preview in task modal on task change
---
.../projects/[projectId]/github/client.tsx | 7 ++-
.../projects/[projectId]/members/client.tsx | 32 +++++++----
src/features/audit-logs/utils.ts | 31 ++++-------
src/features/auth/server/route.ts | 55 ++++++++++++++++++-
.../components/enhanced-data-kanban.tsx | 33 ++++++++++-
.../components/connect-repository.tsx | 5 ++
.../github-integration/server/route.ts | 41 +++++++++++---
.../tasks/components/task-preview-modal.tsx | 5 ++
8 files changed, 164 insertions(+), 45 deletions(-)
diff --git a/src/app/(dashboard)/workspaces/[workspaceId]/projects/[projectId]/github/client.tsx b/src/app/(dashboard)/workspaces/[workspaceId]/projects/[projectId]/github/client.tsx
index a155647e..0bf6da34 100644
--- a/src/app/(dashboard)/workspaces/[workspaceId]/projects/[projectId]/github/client.tsx
+++ b/src/app/(dashboard)/workspaces/[workspaceId]/projects/[projectId]/github/client.tsx
@@ -33,11 +33,14 @@ import {
COMMIT_CACHE_CHANNEL,
} from "@/features/github-integration/lib/commit-cache";
import { useWorkspaceId } from "@/features/workspaces/hooks/use-workspace-id";
+import { useProjectPermissions } from "@/hooks/use-project-permissions";
export const GitHubIntegrationClient = () => {
const projectId = useProjectId();
const workspaceId = useWorkspaceId();
const { data: repository, isLoading } = useGetRepository(projectId);
+ const { isProjectAdmin } = useProjectPermissions({ projectId, workspaceId });
+ const canManageGithub = isProjectAdmin;
const [commitsCount, setCommitsCount] = useState(0);
const documentationPath = workspaceId
? `/workspaces/${workspaceId}/projects/${projectId}/github/documentation`
@@ -188,7 +191,7 @@ export const GitHubIntegrationClient = () => {