Skip to content

Commit

Permalink
Merge pull request #2605 from akhilmhdh/feat/permission-phase-2
Browse files Browse the repository at this point in the history
feat: added filter folder to remove read only in migration
  • Loading branch information
maidul98 authored Oct 17, 2024
2 parents 96bad7b + 99e65f7 commit 13c0b31
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions backend/src/ee/services/permission/project-permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,11 +798,13 @@ export const backfillPermissionV1SchemaToV2Schema = (data: z.infer<typeof Projec
};
});

return formattedData.concat(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore-error this is valid ts
secretImportPolicies,
dynamicSecretPolicies,
hasReadOnlyFolder.length ? [] : secretFolderPolicies
);
return formattedData
.filter((i) => i.subject !== ProjectPermissionSub.SecretFolders)
.concat(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore-error this is valid ts
secretImportPolicies,
dynamicSecretPolicies,
hasReadOnlyFolder.length ? [] : secretFolderPolicies
);
};

0 comments on commit 13c0b31

Please sign in to comment.