Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: improve membership check#25326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
keithwillcode merged 7 commits intomainfromimprove-membership-check
Nov 21, 2025
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix: update change role validation
  • Loading branch information
@Ryukemeister
Ryukemeister committedNov 21, 2025
commita7f58373d2b57f5ad0544ba8ed65e2f893aea69f
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import { isTeamOwner } from "@calcom/features/ee/teams/lib/queries";
import { isOrganisationAdmin } from "@calcom/lib/server/queries/organisations";
import { isOrganisationAdmin, isOrganisationOwner } from "@calcom/lib/server/queries/organisations";
import { prisma } from "@calcom/prisma";
import type { Membership } from "@calcom/prisma/client";
import { MembershipRole } from "@calcom/prisma/enums";
Expand DownExpand Up@@ -84,7 +84,10 @@ export class LegacyRoleManager implements IRoleManager {
});
hasPermission = !!team;
} else {
hasPermission = !!(await isOrganisationAdmin(userId, targetId));
hasPermission =
newRole === MembershipRole.OWNER
? !!(await isOrganisationOwner(userId, targetId))
: !!(await isOrganisationAdmin(userId, targetId));
}

// Only OWNER/ADMIN can update role
Expand DownExpand Up@@ -112,7 +115,7 @@ export class LegacyRoleManager implements IRoleManager {
organizationId: number,
role: MembershipRole | string,
// Used in other implementation

_membershipId: number
): Promise<void> {
await prisma.membership.update({
Expand All@@ -129,7 +132,7 @@ export class LegacyRoleManager implements IRoleManager {
}

// Used in other implementation

async getAllRoles(_organizationId: number): Promise<{ id: string; name: string }[]> {
return [
{ id: MembershipRole.OWNER, name: "Owner" },
Expand All@@ -139,7 +142,7 @@ export class LegacyRoleManager implements IRoleManager {
}

// Used in other implementation

async getTeamRoles(_teamId: number): Promise<{ id: string; name: string }[]> {
return [
{ id: MembershipRole.OWNER, name: "Owner" },
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp