mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 21:27:10 +00:00
feat(rbac): resolved secret import not listing
This commit is contained in:
@@ -275,7 +275,9 @@ export const deleteSecretImport = async (req: Request, res: Response) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSecretImports = async (req: Request, res: Response) => {
|
export const getSecretImports = async (req: Request, res: Response) => {
|
||||||
const { workspaceId, environment, folderId } = req.query;
|
const {
|
||||||
|
query: { workspaceId, environment, folderId }
|
||||||
|
} = await validateRequest(reqValidator.GetSecretImportsV1, req);
|
||||||
const importSecDoc = await SecretImport.findOne({
|
const importSecDoc = await SecretImport.findOne({
|
||||||
workspace: workspaceId,
|
workspace: workspaceId,
|
||||||
environment,
|
environment,
|
||||||
@@ -325,11 +327,10 @@ export const getSecretImports = async (req: Request, res: Response) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getAllSecretsFromImport = async (req: Request, res: Response) => {
|
export const getAllSecretsFromImport = async (req: Request, res: Response) => {
|
||||||
const { workspaceId, environment, folderId } = req.query as {
|
const {
|
||||||
workspaceId: string;
|
query: { workspaceId, environment, folderId }
|
||||||
environment: string;
|
} = await validateRequest(reqValidator.GetAllSecretsFromImportV1, req);
|
||||||
folderId: string;
|
|
||||||
};
|
|
||||||
const importSecDoc = await SecretImport.findOne({
|
const importSecDoc = await SecretImport.findOne({
|
||||||
workspace: workspaceId,
|
workspace: workspaceId,
|
||||||
environment,
|
environment,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export const GetSecretImportsV1 = z.object({
|
|||||||
query: z.object({
|
query: z.object({
|
||||||
workspaceId: z.string().trim(),
|
workspaceId: z.string().trim(),
|
||||||
environment: z.string().trim(),
|
environment: z.string().trim(),
|
||||||
folderId: z.string().trim()
|
folderId: z.string().trim().default("root")
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { FormProvider, useFieldArray, useForm } from "react-hook-form";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { subject } from "@casl/ability";
|
import { subject } from "@casl/ability";
|
||||||
import { Can } from "@casl/react";
|
|
||||||
import {
|
import {
|
||||||
closestCenter,
|
closestCenter,
|
||||||
DndContext,
|
DndContext,
|
||||||
@@ -927,10 +926,9 @@ export const DashboardPage = () => {
|
|||||||
<DropdownMenuContent align="end" className="left-20 z-[60] mt-1 w-[10.8rem]">
|
<DropdownMenuContent align="end" className="left-20 z-[60] mt-1 w-[10.8rem]">
|
||||||
<div className="rounded-md border border-mineshaft-600 bg-mineshaft-800 p-1">
|
<div className="rounded-md border border-mineshaft-600 bg-mineshaft-800 p-1">
|
||||||
<div className="w-full pb-1">
|
<div className="w-full pb-1">
|
||||||
<Can
|
<ProjectPermissionCan
|
||||||
ability={permission}
|
I={ProjectPermissionActions.Create}
|
||||||
I={ProjectPermissionActions.Delete}
|
a={ProjectPermissionSub.Folders}
|
||||||
a={ProjectPermissionSub.SecretRollback}
|
|
||||||
>
|
>
|
||||||
{(isAllowed) => (
|
{(isAllowed) => (
|
||||||
<Button
|
<Button
|
||||||
@@ -944,7 +942,7 @@ export const DashboardPage = () => {
|
|||||||
Add Folder
|
Add Folder
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Can>
|
</ProjectPermissionCan>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<ProjectPermissionCan
|
<ProjectPermissionCan
|
||||||
|
|||||||
Reference in New Issue
Block a user