Skip to content

Commit

Permalink
feat: allow governance members to access repository analysis tool
Browse files Browse the repository at this point in the history
  • Loading branch information
shayzluf committed Jan 30, 2025
1 parent de950d0 commit 8a4d9cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hats.finance/shared",
"version": "1.1.125",
"version": "1.1.126",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/Sidebar/NavLinks/NavLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default function NavLinks() {
</StyledNavLink>
<StyledNavLink
className="sub"
hidden={!isGrowthMember}
hidden={!isGrowthMember && !isGovMember}
to={`${RoutePaths.committee_tools}/repo-analysis`}
onClick={handleClick}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState } from "react";
import { AnalysisResponse, ExcludePatterns } from "../types";
import { useSiweAuth } from "hooks/siwe/useSiweAuth";
import { useIsGrowthMember } from "hooks/useIsGrowthMember";
import { useIsGovMember } from "hooks/useIsGovMember";
import { BASE_SERVICE_URL } from "settings";

export const useRepoAnalysis = () => {
Expand All @@ -10,10 +11,11 @@ export const useRepoAnalysis = () => {
const [error, setError] = useState<string | null>(null);
const { currentSiweData } = useSiweAuth();
const isGrowthMember = useIsGrowthMember();
const isGovMember = useIsGovMember();

const analyzeRepo = async (repoOwner: string, repoName: string, excludePatterns?: ExcludePatterns) => {
if (!isGrowthMember) {
setError("Unauthorized: Only growth team members can access this feature");
if (!isGrowthMember && !isGovMember) {
setError("Unauthorized: Only growth team and governance members can access this feature");
return;
}

Expand Down

0 comments on commit 8a4d9cd

Please sign in to comment.