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
@@ -9,7 +9,8 @@ import { UsersService } from "@/modules/users/services/users.service";
|
||||
import { UserWithProfile } from "@/modules/users/users.repository";
|
||||
import { Injectable, NotFoundException, ForbiddenException } from "@nestjs/common";
|
||||
|
||||
import { MembershipRole, getClientSecretFromPayment } from "@calcom/platform-libraries";
|
||||
import { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";
|
||||
import { getClientSecretFromPayment } from "@calcom/platform-libraries";
|
||||
import type { TeamQuery } from "@calcom/platform-libraries";
|
||||
import { enrichUserWithDelegationConferencingCredentialsWithoutOrgId } from "@calcom/platform-libraries/app-store";
|
||||
import { getEnabledAppsFromCredentials, getAppFromSlug } from "@calcom/platform-libraries/app-store";
|
||||
@@ -259,9 +260,7 @@ export class EventTypesAtomService {
|
||||
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