fix #12815: user not able to create ingestion pipeline with isOwner() or matchTeam() conditions (#12852)

* fix ingestion tab not showing issue for user in owner team on service page

* worked on comments

* worked on comments
This commit is contained in:
Aniket Katkar 2023-08-16 15:10:16 +05:30 committed by GitHub
parent a74e5bf217
commit d2f3d45276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -914,8 +914,16 @@ const ServiceDetailsPage: FunctionComponent = () => {
const tabs: TabsProps['items'] = useMemo(() => {
const tabs = [];
const isOwner = AppState.userDetails.id === serviceDetails?.owner?.id;
const showIngestionTab = Boolean(isOwner || isAdminUser);
const userOwnsService =
AppState.userDetails.id === serviceDetails?.owner?.id;
const userInOwnerTeam = Boolean(
AppState.userDetails.teams?.some(
(team) => team.id === serviceDetails?.owner?.id
)
);
const showIngestionTab = userInOwnerTeam || userOwnsService || isAdminUser;
if (serviceCategory !== ServiceCategory.METADATA_SERVICES) {
tabs.push({