Skip to content

Commit 1f62b5a

Browse files
committed
Update auth checkbox for users
1 parent 8bd08f3 commit 1f62b5a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/model-serving/src/components/deploymentWizard/fields/TokenAuthenticationField.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const useTokenAuthenticationField = (
5353
existingData?: TokenAuthenticationFieldData,
5454
modelType?: ModelTypeField,
5555
modelServer?: ModelServerSelectField,
56+
canCreateRoleBindings?: boolean,
5657
): TokenAuthenticationFieldHook => {
5758
const tokenAuthExtension = useWizardFieldFromExtension(isTokenAuthField, {
5859
modelType: { data: modelType?.data },
@@ -63,8 +64,7 @@ export const useTokenAuthenticationField = (
6364
}, [tokenAuthExtension]);
6465

6566
const initialData = React.useMemo(() => {
66-
// only auto check on create
67-
if (shouldAutoCheck && !existingData) {
67+
if (shouldAutoCheck && !existingData && canCreateRoleBindings === true) {
6868
return [
6969
{
7070
uuid: getUniqueId('ml'),
@@ -74,7 +74,7 @@ export const useTokenAuthenticationField = (
7474
];
7575
}
7676
return existingData || [];
77-
}, [shouldAutoCheck, existingData]);
77+
}, [shouldAutoCheck, existingData, canCreateRoleBindings]);
7878

7979
const [tokenAuthData, setTokenAuthData] = React.useState<
8080
TokenAuthenticationFieldData | undefined

packages/model-serving/src/components/deploymentWizard/useDeploymentWizard.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const useModelDeploymentWizard = (
113113
initialData?.tokenAuthentication ?? undefined,
114114
modelType,
115115
modelServer,
116+
canCreateRoleBindings,
116117
);
117118

118119
const runtimeArgs = useRuntimeArgsField(initialData?.runtimeArgs ?? undefined);

0 commit comments

Comments
 (0)