mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 19:16:22 +00:00
update permission action name for org admin console
This commit is contained in:
@@ -25,7 +25,7 @@ export enum OrgPermissionSubjects {
|
||||
}
|
||||
|
||||
export enum OrgPermissionAdminConsoleAction {
|
||||
GrantAccessProjects = "grant-access-projects"
|
||||
AccessAllProjects = "access-all-projects"
|
||||
}
|
||||
|
||||
export type OrgPermissionSet =
|
||||
|
||||
@@ -14,7 +14,7 @@ const generalPermissionSchema = z
|
||||
|
||||
const adminConsolePermissionSchmea = z
|
||||
.object({
|
||||
"grant-access-projects": z.boolean().optional()
|
||||
"access-all-projects": z.boolean().optional()
|
||||
})
|
||||
.optional();
|
||||
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@ enum Permission {
|
||||
}
|
||||
|
||||
const PERMISSION_ACTIONS = [
|
||||
{ action: "grant-access-projects", label: "Grant access projects" }
|
||||
{ action: "access-all-projects", label: "Access all organization projects" }
|
||||
] as const;
|
||||
|
||||
export const OrgPermissionAdminConsoleRow = ({ isEditable, control, setValue }: Props) => {
|
||||
@@ -33,7 +33,7 @@ export const OrgPermissionAdminConsoleRow = ({ isEditable, control, setValue }:
|
||||
});
|
||||
|
||||
const selectedPermissionCategory = useMemo(() => {
|
||||
if (rule?.["grant-access-projects"]) {
|
||||
if (rule?.["access-all-projects"]) {
|
||||
return Permission.Custom;
|
||||
}
|
||||
return Permission.NoAccess;
|
||||
@@ -63,7 +63,7 @@ export const OrgPermissionAdminConsoleRow = ({ isEditable, control, setValue }:
|
||||
if (val === Permission.NoAccess) {
|
||||
setValue(
|
||||
"permissions.admin-console",
|
||||
{ "grant-access-projects": false },
|
||||
{ "access-all-projects": false },
|
||||
{ shouldDirty: true }
|
||||
);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export const OrgPermissionAdminConsoleRow = ({ isEditable, control, setValue }:
|
||||
<Td>
|
||||
<FontAwesomeIcon icon={isRowExpanded ? faChevronDown : faChevronRight} />
|
||||
</Td>
|
||||
<Td>Admin Console</Td>
|
||||
<Td>Organization Admin Console</Td>
|
||||
<Td>
|
||||
<Select
|
||||
value={selectedPermissionCategory}
|
||||
|
||||
@@ -161,7 +161,7 @@ export const OrgAdminProjects = withPermission(
|
||||
);
|
||||
},
|
||||
{
|
||||
action: OrgPermissionAdminConsoleAction.GrantAccessProjects,
|
||||
action: OrgPermissionAdminConsoleAction.AccessAllProjects,
|
||||
subject: OrgPermissionSubjects.AdminConsole
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user