Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat: move feature to org level
ShubhamPalriwalaf85a35fde8a2
diff --git a/backend/src/ee/services/permission/org-permission.ts b/backend/src/ee/services/permission/org-permission.tsindex 9fece040bc..d76406cfd3 100644--- a/backend/src/ee/services/permission/org-permission.ts+++ b/backend/src/ee/services/permission/org-permission.ts@@ -21,6 +21,7 @@ export enum OrgPermissionSubjects {Groups = "groups",Billing = "billing",SecretScanning = "secret-scanning",+ SecretSharing = "secret-sharing",Identity = "identity"}@@ -36,6 +37,7 @@ export type OrgPermissionSet =| [OrgPermissionActions, OrgPermissionSubjects.Ldap]| [OrgPermissionActions, OrgPermissionSubjects.Groups]| [OrgPermissionActions, OrgPermissionSubjects.SecretScanning]+ | [OrgPermissionActions, OrgPermissionSubjects.SecretSharing]| [OrgPermissionActions, OrgPermissionSubjects.Billing]| [OrgPermissionActions, OrgPermissionSubjects.Identity];@@ -60,6 +62,10 @@ const buildAdminPermission = () => {can(OrgPermissionActions.Edit, OrgPermissionSubjects.SecretScanning);can(OrgPermissionActions.Delete, OrgPermissionSubjects.SecretScanning);+ can(OrgPermissionActions.Read, OrgPermissionSubjects.SecretSharing);+ can(OrgPermissionActions.Create, OrgPermissionSubjects.SecretSharing);+ can(OrgPermissionActions.Delete, OrgPermissionSubjects.SecretSharing);+can(OrgPermissionActions.Read, OrgPermissionSubjects.Settings);can(OrgPermissionActions.Create, OrgPermissionSubjects.Settings);can(OrgPermissionActions.Edit, OrgPermissionSubjects.Settings);@@ -124,6 +130,10 @@ const buildMemberPermission = () => {can(OrgPermissionActions.Edit, OrgPermissionSubjects.SecretScanning);can(OrgPermissionActions.Delete, OrgPermissionSubjects.SecretScanning);+ can(OrgPermissionActions.Read, OrgPermissionSubjects.SecretSharing);+ can(OrgPermissionActions.Create, OrgPermissionSubjects.SecretSharing);+ can(OrgPermissionActions.Delete, OrgPermissionSubjects.SecretSharing);+can(OrgPermissionActions.Read, OrgPermissionSubjects.Identity);can(OrgPermissionActions.Create, OrgPermissionSubjects.Identity);can(OrgPermissionActions.Edit, OrgPermissionSubjects.Identity);diff --git a/backend/src/ee/services/permission/project-permission.ts b/backend/src/ee/services/permission/project-permission.tsindex 8deb6f57e9..b24024bd4e 100644--- a/backend/src/ee/services/permission/project-permission.ts+++ b/backend/src/ee/services/permission/project-permission.ts@@ -26,7 +26,6 @@ export enum ProjectPermissionSub {SecretRollback = "secret-rollback",SecretApproval = "secret-approval",SecretRotation = "secret-rotation",- SecretSharing = "secret-sharing",Identity = "identity"}@@ -53,7 +52,6 @@ export type ProjectPermissionSet =| [ProjectPermissionActions, ProjectPermissionSub.ServiceTokens]| [ProjectPermissionActions, ProjectPermissionSub.SecretApproval]| [ProjectPermissionActions, ProjectPermissionSub.SecretRotation]- | [ProjectPermissionActions, ProjectPermissionSub.SecretSharing]| [ProjectPermissionActions, ProjectPermissionSub.Identity]| [ProjectPermissionActions.Delete, ProjectPermissionSub.Project]| [ProjectPermissionActions.Edit, ProjectPermissionSub.Project]@@ -73,10 +71,6 @@ const buildAdminPermissionRules = () => {can(ProjectPermissionActions.Edit, ProjectPermissionSub.SecretApproval);can(ProjectPermissionActions.Delete, ProjectPermissionSub.SecretApproval);- can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretSharing);- can(ProjectPermissionActions.Create, ProjectPermissionSub.SecretSharing);- can(ProjectPermissionActions.Delete, ProjectPermissionSub.SecretSharing);-can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRotation);can(ProjectPermissionActions.Create, ProjectPermissionSub.SecretRotation);can(ProjectPermissionActions.Edit, ProjectPermissionSub.SecretRotation);@@ -164,10 +158,6 @@ const buildMemberPermissionRules = () => {can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretApproval);can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRotation);- can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretSharing);- can(ProjectPermissionActions.Create, ProjectPermissionSub.SecretSharing);- can(ProjectPermissionActions.Delete, ProjectPermissionSub.SecretSharing);-can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRollback);can(ProjectPermissionActions.Create, ProjectPermissionSub.SecretRollback);@@ -227,7 +217,6 @@ const buildViewerPermissionRules = () => {can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretApproval);can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRollback);can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRotation);- can(ProjectPermissionActions.Read, ProjectPermissionSub.SecretSharing);can(ProjectPermissionActions.Read, ProjectPermissionSub.Member);can(ProjectPermissionActions.Read, ProjectPermissionSub.Groups);can(ProjectPermissionActions.Read, ProjectPermissionSub.Role);diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex f8855d11f3..582f70d5a9 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -201,8 +201,6 @@ export const registerRoutes = async (const secretVersionTagDAL = secretVersionTagDALFactory(db);const secretBlindIndexDAL = secretBlindIndexDALFactory(db);- const secretSharingDAL = secretSharingDALFactory(db);-const integrationDAL = integrationDALFactory(db);const integrationAuthDAL = integrationAuthDALFactory(db);const webhookDAL = webhookDALFactory(db);@@ -257,6 +255,7 @@ export const registerRoutes = async (const groupProjectMembershipRoleDAL = groupProjectMembershipRoleDALFactory(db);const userGroupMembershipDAL = userGroupMembershipDALFactory(db);const secretScanningDAL = secretScanningDALFactory(db);+ const secretSharingDAL = secretSharingDALFactory(db);const licenseDAL = licenseDALFactory(db);const dynamicSecretDAL = dynamicSecretDALFactory(db);const dynamicSecretLeaseDAL = dynamicSecretLeaseDALFactory(db);diff --git a/backend/src/server/routes/v1/secret-sharing-router.ts b/backend/src/server/routes/v1/secret-sharing-router.tsindex 6a7f955651..f5f47d3454 100644--- a/backend/src/server/routes/v1/secret-sharing-router.ts+++ b/backend/src/server/routes/v1/secret-sharing-router.ts@@ -8,25 +8,21 @@ import { AuthMode } from "@app/services/auth/auth-type";export const registerSecretSharingRouter = async (server: FastifyZodProvider) => {server.route({method: "GET",- url: "/:projectId",+ url: "/",config: {rateLimit: readLimit},schema: {- params: z.object({- projectId: z.string().uuid()- }),response: {200: z.array(SecretSharingSchema)}},onRequest: verifyAuth([AuthMode.JWT]),handler: async (req) => {- const { projectId } = req.params;const sharedSecrets = await req.server.services.secretSharing.getSharedSecrets({actor: req.permission.type,actorId: req.permission.id,- projectId,+ orgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId});@@ -72,8 +68,7 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>signedValue: z.string(),expiresAt: z.string().refine((date) => new Date(date) > new Date(), {message: "Expires at should be a future date"- }),- workspaceId: z.string().uuid()+ })}),response: {200: z.object({@@ -83,11 +78,11 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>},onRequest: verifyAuth([AuthMode.JWT]),handler: async (req) => {- const { name, signedValue, expiresAt, workspaceId } = req.body;+ const { name, signedValue, expiresAt } = req.body;const sharedSecret = await req.server.services.secretSharing.createSharedSecret({actor: req.permission.type,actorId: req.permission.id,- projectId: workspaceId,+ orgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,name,@@ -100,13 +95,12 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>server.route({method: "DELETE",- url: "/:projectId/:sharedSecretId",+ url: "/:sharedSecretId",config: {rateLimit: writeLimit},schema: {params: z.object({- projectId: z.string().uuid(),sharedSecretId: z.string().uuid()}),response: {@@ -115,11 +109,11 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>},onRequest: verifyAuth([AuthMode.JWT]),handler: async (req) => {- const { projectId, sharedSecretId } = req.params;+ const { sharedSecretId } = req.params;const deletedSharedSecret = await req.server.services.secretSharing.deleteSharedSecretById({actor: req.permission.type,actorId: req.permission.id,- projectId,+ orgId: req.permission.orgId,actorAuthMethod: req.permission.authMethod,actorOrgId: req.permission.orgId,sharedSecretIddiff --git a/backend/src/services/secret-sharing/secret-sharing-service.ts b/backend/src/services/secret-sharing/secret-sharing-service.tsindex 7fdc8f6aaf..a4952586af 100644--- a/backend/src/services/secret-sharing/secret-sharing-service.ts+++ b/backend/src/services/secret-sharing/secret-sharing-service.ts@@ -1,13 +1,13 @@import { ForbiddenError } from "@casl/ability";+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/ee/services/permission/org-permission";import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";import { TSecretSharingDALFactory } from "./secret-sharing-dal";import { TCreateSharedSecretDTO, TDeleteSharedSecretDTO, TSharedSecretPermission } from "./secret-sharing-types";type TSecretSharingServiceFactoryDep = {- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;+ permissionService: Pick<TPermissionServiceFactory, "getOrgPermission">;secretSharingDAL: TSecretSharingDALFactory;};@@ -18,16 +18,10 @@ export const secretSharingServiceFactory = ({secretSharingDAL}: TSecretSharingServiceFactoryDep) => {const createSharedSecret = async (createSharedSecretInput: TCreateSharedSecretDTO) => {- const { actor, actorId, projectId, actorAuthMethod, actorOrgId, name, signedValue, expiresAt } =+ const { actor, actorId, orgId, actorAuthMethod, actorOrgId, name, signedValue, expiresAt } =createSharedSecretInput;- const { permission } = await permissionService.getProjectPermission(- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId- );- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.SecretSharing);+ const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);+ ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.SecretSharing);const newSharedSecret = await secretSharingDAL.create({name,signedValue,@@ -38,15 +32,9 @@ export const secretSharingServiceFactory = ({};const getSharedSecrets = async (getSharedSecretsInput: TSharedSecretPermission) => {- const { actor, actorId, projectId, actorAuthMethod, actorOrgId } = getSharedSecretsInput;- const { permission } = await permissionService.getProjectPermission(- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId- );- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SecretSharing);+ const { actor, actorId, orgId, actorAuthMethod, actorOrgId } = getSharedSecretsInput;+ const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);+ ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Read, OrgPermissionSubjects.SecretSharing);const userSharedSecrets = await secretSharingDAL.find({ userId: actorId }, { sort: [["expiresAt", "asc"]] });return userSharedSecrets;};@@ -60,15 +48,9 @@ export const secretSharingServiceFactory = ({};const deleteSharedSecretById = async (deleteSharedSecretInput: TDeleteSharedSecretDTO) => {- const { actor, actorId, projectId, actorAuthMethod, actorOrgId, sharedSecretId } = deleteSharedSecretInput;- const { permission } = await permissionService.getProjectPermission(- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId- );- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.SecretSharing);+ const { actor, actorId, orgId, actorAuthMethod, actorOrgId, sharedSecretId } = deleteSharedSecretInput;+ const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);+ ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Delete, OrgPermissionSubjects.SecretSharing);const deletedSharedSecret = await secretSharingDAL.deleteById(sharedSecretId);return deletedSharedSecret;};diff --git a/backend/src/services/secret-sharing/secret-sharing-types.ts b/backend/src/services/secret-sharing/secret-sharing-types.tsindex c08f42612d..643aec230c 100644--- a/backend/src/services/secret-sharing/secret-sharing-types.ts+++ b/backend/src/services/secret-sharing/secret-sharing-types.ts@@ -5,7 +5,7 @@ export type TSharedSecretPermission = {actorId: string;actorAuthMethod: ActorAuthMethod;actorOrgId: string;- projectId: string;+ orgId: string;};export type TCreateSharedSecretDTO = {diff --git a/frontend/src/context/OrgPermissionContext/types.ts b/frontend/src/context/OrgPermissionContext/types.tsindex 95a9d00acf..d51191ece6 100644--- a/frontend/src/context/OrgPermissionContext/types.ts+++ b/frontend/src/context/OrgPermissionContext/types.ts@@ -19,6 +19,7 @@ export enum OrgPermissionSubjects {Groups = "groups",Billing = "billing",SecretScanning = "secret-scanning",+ SecretSharing = "secret-sharing",Identity = "identity"}@@ -34,6 +35,7 @@ export type OrgPermissionSet =| [OrgPermissionActions, OrgPermissionSubjects.Ldap]| [OrgPermissionActions, OrgPermissionSubjects.Groups]| [OrgPermissionActions, OrgPermissionSubjects.SecretScanning]+ | [OrgPermissionActions, OrgPermissionSubjects.SecretSharing]| [OrgPermissionActions, OrgPermissionSubjects.Billing]| [OrgPermissionActions, OrgPermissionSubjects.Identity];diff --git a/frontend/src/hooks/api/secretSharing/mutations.ts b/frontend/src/hooks/api/secretSharing/mutations.tsindex a3566282ce..e21cc08f6d 100644--- a/frontend/src/hooks/api/secretSharing/mutations.ts+++ b/frontend/src/hooks/api/secretSharing/mutations.ts@@ -20,11 +20,11 @@ export const useDeleteSharedSecret = () => {return useMutation<TSharedSecret,{ message: string },- { sharedSecretId: string; workspaceId: string }+ { sharedSecretId: string }>({- mutationFn: async ({ sharedSecretId, workspaceId }: TDeleteSharedSecretRequest) => {+ mutationFn: async ({ sharedSecretId }: TDeleteSharedSecretRequest) => {const { data } = await apiRequest.delete<TSharedSecret>(- `/api/v1/secret-sharing/${workspaceId}/${sharedSecretId}`+ `/api/v1/secret-sharing/${sharedSecretId}`);return data;},diff --git a/frontend/src/hooks/api/secretSharing/queries.ts b/frontend/src/hooks/api/secretSharing/queries.tsindex 33ffddfbcc..ad5bbee74c 100644--- a/frontend/src/hooks/api/secretSharing/queries.ts+++ b/frontend/src/hooks/api/secretSharing/queries.ts@@ -4,12 +4,12 @@ import { apiRequest } from "@app/config/request";import { TSharedSecret, TViewSharedSecretResponse } from "./types";-export const useGetSharedSecrets = (workspaceId: string) => {+export const useGetSharedSecrets = () => {return useQuery({queryKey: ["sharedSecrets"],queryFn: async () => {const { data } = await apiRequest.get<TSharedSecret[]>(- `/api/v1/secret-sharing/${workspaceId}`+ "/api/v1/secret-sharing/");return data;}diff --git a/frontend/src/hooks/api/secretSharing/types.ts b/frontend/src/hooks/api/secretSharing/types.tsindex 6afbe34ead..ca9cb76b8b 100644--- a/frontend/src/hooks/api/secretSharing/types.ts+++ b/frontend/src/hooks/api/secretSharing/types.ts@@ -12,7 +12,6 @@ export type TCreateSharedSecretRequest = {name: string;signedValue: string;expiresAt: Date;- workspaceId: string;};export type TViewSharedSecretResponse = {@@ -23,5 +22,4 @@ export type TViewSharedSecretResponse = {export type TDeleteSharedSecretRequest = {sharedSecretId: string;- workspaceId: string;};diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsxindex 60c31b72c7..1b5df00379 100644--- a/frontend/src/layouts/AppLayout/AppLayout.tsx+++ b/frontend/src/layouts/AppLayout/AppLayout.tsx@@ -531,18 +531,6 @@ export const AppLayout = ({ children }: LayoutProps) => {</MenuItem></a></Link>- <Link href={`/project/${currentWorkspace?.id}/secret-sharing`} passHref>- <a>- <MenuItem- isSelected={- router.asPath === `/project/${currentWorkspace?.id}/secret-sharing`- }- icon="system-outline-90-lock-closed"- >- Secret Sharing- </MenuItem>- </a>- </Link><Link href={`/integrations/${currentWorkspace?.id}`} passHref><a><MenuItem@@ -642,6 +630,18 @@ export const AppLayout = ({ children }: LayoutProps) => {</MenuItem></a></Link>+ <Link href={`/org/${currentOrg?.id}/secret-sharing`} passHref>+ <a>+ <MenuItem+ isSelected={+ router.asPath === `/org/${currentOrg?.id}/secret-sharing`+ }+ icon="system-outline-90-lock-closed"+ >+ Secret Sharing+ </MenuItem>+ </a>+ </Link>{(window.location.origin.includes("https://app.infisical.com") ||window.location.origin.includes("https://gamma.infisical.com")) && (<Link href={`/org/${currentOrg?.id}/billing`} passHref>diff --git a/frontend/src/pages/project/[id]/secret-sharing/index.tsx b/frontend/src/pages/org/[id]/secret-sharing/index.tsxsimilarity index 100%rename from frontend/src/pages/project/[id]/secret-sharing/index.tsxrename to frontend/src/pages/org/[id]/secret-sharing/index.tsxdiff --git a/frontend/src/views/ShareSecretPage/components/AddShareSecretModal.tsx b/frontend/src/views/ShareSecretPage/components/AddShareSecretModal.tsxindex cb4c328660..4ffe1408af 100644--- a/frontend/src/views/ShareSecretPage/components/AddShareSecretModal.tsx+++ b/frontend/src/views/ShareSecretPage/components/AddShareSecretModal.tsx@@ -22,7 +22,7 @@ import {Select,SelectItem} from "@app/components/v2";-import { useWorkspace } from "@app/context";+import { useOrganization } from "@app/context";import { useToggle } from "@app/hooks";import { useCreateSharedSecret } from "@app/hooks/api/secretSharing";import { UsePopUpState } from "@app/hooks/usePopUp";@@ -87,7 +87,7 @@ export const AddShareSecretModal = ({ popUp, handlePopUpToggle }: Props) => {resolver: yupResolver(schema)});const createSharedSecret = useCreateSharedSecret();- const { currentWorkspace } = useWorkspace();+ const { currentOrg } = useOrganization();const [newSharedSecret, setnewSharedSecret] = useState("");const [isUrlCopied, setIsUrlCopied] = useToggle(false);const hasSharedSecret = Boolean(newSharedSecret);@@ -108,7 +108,7 @@ export const AddShareSecretModal = ({ popUp, handlePopUpToggle }: Props) => {const onFormSubmit = async ({ name, value, expiresInValue, expiresInUnit }: FormData) => {try {- if (!currentWorkspace?.id) return;+ if (!currentOrg?.id) return;const signingKeyPair = generateSignKeyPair();const signedMessage = signAssymmetric({@@ -128,7 +128,6 @@ export const AddShareSecretModal = ({ popUp, handlePopUpToggle }: Props) => {name,signedValue: signedMessage,expiresAt,- workspaceId: currentWorkspace.id});setnewSharedSecret(`${window.location.origin}/shared/secret/${id}?key=${encodeURIComponent(diff --git a/frontend/src/views/ShareSecretPage/components/ShareSecretSection.tsx b/frontend/src/views/ShareSecretPage/components/ShareSecretSection.tsxindex 971b77261b..e7311ee858 100644--- a/frontend/src/views/ShareSecretPage/components/ShareSecretSection.tsx+++ b/frontend/src/views/ShareSecretPage/components/ShareSecretSection.tsx@@ -3,10 +3,10 @@ import { faPlus } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";+import { OrgPermissionCan } from "@app/components/permissions";import { Button, Checkbox, DeleteActionModal } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";-import { withProjectPermission } from "@app/hoc";+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";+import { withPermission } from "@app/hoc";import { usePopUp } from "@app/hooks";import { useDeleteSharedSecret } from "@app/hooks/api/secretSharing";@@ -15,9 +15,8 @@ import { ShareSecretsTable } from "./ShareSecretsTable";type DeleteModalData = { name: string; id: string };-export const ShareSecretSection = withProjectPermission(+export const ShareSecretSection = withPermission(() => {- const { currentWorkspace } = useWorkspace();const deleteSharedSecret = useDeleteSharedSecret();const [showExpiredSharedSecrets, setShowExpiredSharedSecrets] = useState(false);@@ -28,10 +27,8 @@ export const ShareSecretSection = withProjectPermission(const onDeleteApproved = async () => {try {- if (!currentWorkspace?.id) return;deleteSharedSecret.mutateAsync({sharedSecretId: (popUp?.deleteSharedSecretConfirmation?.data as DeleteModalData)?.id,- workspaceId: currentWorkspace.id});createNotification({text: "Successfully deleted shared secret",@@ -52,9 +49,9 @@ export const ShareSecretSection = withProjectPermission(<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4"><div className="mb-2 flex justify-between"><p className="text-xl font-semibold text-mineshaft-100">Shared Secrets</p>- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.SecretSharing}+ <OrgPermissionCan+ I={OrgPermissionActions.Create}+ a={OrgPermissionSubjects.SecretSharing}>{(isAllowed) => (<Button@@ -68,7 +65,7 @@ export const ShareSecretSection = withProjectPermission(Share Secret</Button>)}- </ProjectPermissionCan>+ </OrgPermissionCan></div><div className="mb-8 flex items-center justify-between"><p className="flex-grow text-gray-400">@@ -93,9 +90,8 @@ export const ShareSecretSection = withProjectPermission(<AddShareSecretModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} /><DeleteActionModalisOpen={popUp.deleteSharedSecretConfirmation.isOpen}- title={`Delete ${- (popUp?.deleteSharedSecretConfirmation?.data as DeleteModalData)?.name || " "- } shared secret?`}+ title={`Delete ${(popUp?.deleteSharedSecretConfirmation?.data as DeleteModalData)?.name || " "+ } shared secret?`}onChange={(isOpen) => handlePopUpToggle("deleteSharedSecretConfirmation", isOpen)}deleteKey={(popUp?.deleteSharedSecretConfirmation?.data as DeleteModalData)?.name}onClose={() => handlePopUpClose("deleteSharedSecretConfirmation")}@@ -104,5 +100,5 @@ export const ShareSecretSection = withProjectPermission(</div>);},- { action: ProjectPermissionActions.Read, subject: ProjectPermissionSub.SecretSharing }+ { action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.SecretSharing });diff --git a/frontend/src/views/ShareSecretPage/components/ShareSecretsRow.tsx b/frontend/src/views/ShareSecretPage/components/ShareSecretsRow.tsxindex 8d3b89f23a..e4a104f698 100644--- a/frontend/src/views/ShareSecretPage/components/ShareSecretsRow.tsx+++ b/frontend/src/views/ShareSecretPage/components/ShareSecretsRow.tsx@@ -2,9 +2,9 @@ import { useEffect, useState } from "react";import { faTrashCan } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { ProjectPermissionCan } from "@app/components/permissions";+import { OrgPermissionCan } from "@app/components/permissions";import { IconButton, Td, Tr } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";import { TSharedSecret } from "@app/hooks/api/secretSharing";import { UsePopUpState } from "@app/hooks/usePopUp";@@ -110,9 +110,9 @@ export const ShareSecretsRow = ({<p className="text-xs text-gray-500">{formatDate(row.expiresAt)}</p></Td><Td>- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.SecretSharing}+ <OrgPermissionCan+ I={OrgPermissionActions.Delete}+ a={OrgPermissionSubjects.SecretSharing}>{(isAllowed) => (<IconButton@@ -129,7 +129,7 @@ export const ShareSecretsRow = ({<FontAwesomeIcon icon={faTrashCan} /></IconButton>)}- </ProjectPermissionCan>+ </OrgPermissionCan></Td></Tr>);diff --git a/frontend/src/views/ShareSecretPage/components/ShareSecretsTable.tsx b/frontend/src/views/ShareSecretPage/components/ShareSecretsTable.tsxindex eac3435e3e..4d3321eaaa 100644--- a/frontend/src/views/ShareSecretPage/components/ShareSecretsTable.tsx+++ b/frontend/src/views/ShareSecretPage/components/ShareSecretsTable.tsx@@ -12,7 +12,6 @@ import {THead,Tr} from "@app/components/v2";-import { useWorkspace } from "@app/context";import { TSharedSecret, useGetSharedSecrets } from "@app/hooks/api/secretSharing";import { UsePopUpState } from "@app/hooks/usePopUp";@@ -34,9 +33,7 @@ type Props = {export const ShareSecretsTable = ({ handlePopUpOpen, showExpiredSharedSecrets }: Props) => {const [tableData, setTableData] = useState<TSharedSecret[]>([]);- const { currentWorkspace } = useWorkspace();- const workspaceId = currentWorkspace?.id || "";- const { isLoading, data = [] } = useGetSharedSecrets(workspaceId);+ const { isLoading, data = [] } = useGetSharedSecrets();useEffect(() => {if (!isLoading) {