refactor: use permission check service for isTeamAdmin (#24026)
* saml * addGuests.handler.ts * rename canAccess to canAccessOrganization and use organization.read * update usages * team update handler * team member invite * event type update * remove isTeamAdmin util * updateInternalNotesPresets * setInviteExpiration * event type update * deleteInvite * createInvite * team publish * fixes * final * address feedback * update test
This commit is contained in:
1 parent
2ed0380e4f
commit
8d7cdf9d3b
21 files changed
+238
-145
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { canAccess } from "@calcom/features/ee/sso/lib/saml";
|
||||
import { canAccessOrganization } from "@calcom/features/ee/sso/lib/saml";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
|
||||
|
||||
@@ -16,7 +16,7 @@ const userCanCreateTeamGroupMapping = async (
|
||||
});
|
||||
}
|
||||
|
||||
const { message, access } = await canAccess(user, organizationId);
|
||||
const { message, access } = await canAccessOrganization(user, organizationId);
|
||||
if (!access) {
|
||||
throw new TRPCError({
|
||||
code: "BAD_REQUEST",
|
||||
|
||||
Reference in new issue
Block a user