mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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) => {
|
||||
const { workspaceId, environment, folderId } = req.query;
|
||||
const {
|
||||
query: { workspaceId, environment, folderId }
|
||||
} = await validateRequest(reqValidator.GetSecretImportsV1, req);
|
||||
const importSecDoc = await SecretImport.findOne({
|
||||
workspace: workspaceId,
|
||||
environment,
|
||||
@@ -325,11 +327,10 @@ export const getSecretImports = async (req: Request, res: Response) => {
|
||||
};
|
||||
|
||||
export const getAllSecretsFromImport = async (req: Request, res: Response) => {
|
||||
const { workspaceId, environment, folderId } = req.query as {
|
||||
workspaceId: string;
|
||||
environment: string;
|
||||
folderId: string;
|
||||
};
|
||||
const {
|
||||
query: { workspaceId, environment, folderId }
|
||||
} = await validateRequest(reqValidator.GetAllSecretsFromImportV1, req);
|
||||
|
||||
const importSecDoc = await SecretImport.findOne({
|
||||
workspace: workspaceId,
|
||||
environment,
|
||||
|
||||
@@ -40,7 +40,7 @@ export const GetSecretImportsV1 = z.object({
|
||||
query: z.object({
|
||||
workspaceId: 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 { useRouter } from "next/router";
|
||||
import { subject } from "@casl/ability";
|
||||
import { Can } from "@casl/react";
|
||||
import {
|
||||
closestCenter,
|
||||
DndContext,
|
||||
@@ -927,10 +926,9 @@ export const DashboardPage = () => {
|
||||
<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="w-full pb-1">
|
||||
<Can
|
||||
ability={permission}
|
||||
I={ProjectPermissionActions.Delete}
|
||||
a={ProjectPermissionSub.SecretRollback}
|
||||
<ProjectPermissionCan
|
||||
I={ProjectPermissionActions.Create}
|
||||
a={ProjectPermissionSub.Folders}
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<Button
|
||||
@@ -944,7 +942,7 @@ export const DashboardPage = () => {
|
||||
Add Folder
|
||||
</Button>
|
||||
)}
|
||||
</Can>
|
||||
</ProjectPermissionCan>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<ProjectPermissionCan
|
||||
|
||||
Reference in New Issue
Block a user