fix: add isAdminOrOwner and useIsOrgAdminOrOwner (#20429)
* fix: add isAdminOrOwner and useIsOrgAdminOrOwner * make useIsOrgAdminOrOwner to accept session * revert change * remove useIsOrgAdminOrOwner and rename isAdminOrOwner to checkAdminOrOwner * fix type * fix type * fix import
This commit is contained in:
1 parent
3456477012
commit
5b08b9f11f
32 files changed
+88
-124
No files matched your search
@@ -4,12 +4,12 @@ import appStore from "@calcom/app-store";
|
||||
import type { TDependencyData } from "@calcom/app-store/_appRegistry";
|
||||
import type { CredentialOwner } from "@calcom/app-store/types";
|
||||
import { getAppFromSlug } from "@calcom/app-store/utils";
|
||||
import { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";
|
||||
import getEnabledAppsFromCredentials from "@calcom/lib/apps/getEnabledAppsFromCredentials";
|
||||
import getInstallCountPerApp from "@calcom/lib/apps/getInstallCountPerApp";
|
||||
import { getUsersCredentials } from "@calcom/lib/server/getUsersCredentials";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import type { User } from "@calcom/prisma/client";
|
||||
import { MembershipRole } from "@calcom/prisma/enums";
|
||||
import type { AppCategories } from "@calcom/prisma/enums";
|
||||
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
|
||||
import type { PaymentApp } from "@calcom/types/PaymentService";
|
||||
@@ -168,9 +168,7 @@ export async function getConnectedApps({
|
||||
name: team.name,
|
||||
logoUrl: team.logoUrl,
|
||||
credentialId: c.id,
|
||||
isAdmin:
|
||||
team.members[0].role === MembershipRole.ADMIN ||
|
||||
team.members[0].role === MembershipRole.OWNER,
|
||||
isAdmin: checkAdminOrOwner(team.members[0].role),
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user