diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgAuthTab/OrgUserAccessTokenLimitSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgAuthTab/OrgUserAccessTokenLimitSection.tsx index a4d074819..43e72bd41 100644 --- a/frontend/src/pages/organization/SettingsPage/components/OrgAuthTab/OrgUserAccessTokenLimitSection.tsx +++ b/frontend/src/pages/organization/SettingsPage/components/OrgAuthTab/OrgUserAccessTokenLimitSection.tsx @@ -3,8 +3,9 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; import { createNotification } from "@app/components/notifications"; +import { OrgPermissionCan } from "@app/components/permissions"; import { Button, FormControl, Input, Select, SelectItem } from "@app/components/v2"; -import { useOrganization } from "@app/context"; +import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context"; import { useUpdateOrg } from "@app/hooks/api"; const formSchema = z.object({ @@ -93,66 +94,78 @@ export const OrgUserAccessTokenLimitSection = () => { This defines the maximum time a user token will be valid. After this time, the user will need to re-authenticate.

-
-
-
- ( - - field.onChange(parseInt(e.target.value, 10) || 1)} - /> - - )} - /> -
-
- ( - - field.onChange(parseInt(e.target.value, 10))} + disabled={!isAllowed} + /> + + )} + /> +
+
+ ( + + - - )} - /> -
-
- -
+ {timeUnits.map(({ value, label }) => ( + +
{label}
+
+ ))} + + + )} + /> + + + + + )} + ); };