1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ProjectResource } from "models/project";
6 import { getResource } from "store/resources/resources";
8 export const resourceIsFrozen = (resource: any, resources): boolean => {
9 let isFrozen: boolean = !!resource.frozenByUuid;
10 let ownerUuid: string | undefined = resource?.ownerUuid;
12 while(!isFrozen && !!ownerUuid && ownerUuid.indexOf('000000000000000') === -1) {
13 const parentResource: ProjectResource | undefined = getResource<ProjectResource>(ownerUuid)(resources);
14 isFrozen = !!parentResource?.frozenByUuid;
15 ownerUuid = parentResource?.ownerUuid;