-const getResourceWritableBy = (state: ResourcesState, id: string, userUuid: string): string[] => {
- if (!id) {
- return [];
- }
-
- if (id === userUuid) {
- return [userUuid];
- }
-
- const resource = (state[id] as ProjectResource);
-
- if (!resource) {
- return [];
- }
-
- const { writableBy } = resource;
-
- return writableBy || getResourceWritableBy(state, resource.ownerUuid, userUuid);
-};
-