fix(docker): apply private uac to edge admin [EE-6788] (#11284)

pull/11368/head
Chaim Lev-Ari 9 months ago committed by GitHub
parent 0144a98b3b
commit b13dac0f6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,7 +1,7 @@
import { useCurrentStateAndParams } from '@uirouter/react';
import { parseAccessControlFormData } from '@/react/portainer/access-control/utils';
import { useCurrentUser, useIsEdgeAdmin } from '@/react/hooks/useUser';
import { useCurrentUser } from '@/react/hooks/useUser';
import { StackType } from '@/react/common/stacks/types';
import { Platform } from '../../types';
@ -19,13 +19,12 @@ export function useInitialValues({
isEdge?: boolean;
buildMethods: Array<Method>;
}): FormValues | undefined {
const { user } = useCurrentUser();
const isAdminQuery = useIsEdgeAdmin();
const { user, isPureAdmin } = useCurrentUser();
const { appTemplateId, type = defaultType } = useAppTemplateParams();
const fileContentQuery = useFetchTemplateFile(appTemplateId);
if (fileContentQuery.isLoading || isAdminQuery.isLoading) {
if (fileContentQuery.isLoading) {
return undefined;
}
@ -53,7 +52,7 @@ export function useInitialValues({
},
AccessControl: isEdge
? undefined
: parseAccessControlFormData(isAdminQuery.isAdmin, user.Id),
: parseAccessControlFormData(isPureAdmin, user.Id),
EdgeSettings: isEdge ? getDefaultEdgeTemplateSettings() : undefined,
};
}

Loading…
Cancel
Save