Skip to content

Commit dd3dbcf

Browse files
authored
Revert "feat: add access control for user profiles (#34)"
This reverts commit a0ffbd1.
1 parent a0ffbd1 commit dd3dbcf

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

app/api/users/[id]/route.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -175,28 +175,6 @@ export async function GET(
175175
);
176176
}
177177

178-
// Access control: a profile is public only while the user is "looking for a
179-
// team" (isLooking). Otherwise it is private and visible only to admins,
180-
// evaluators, the user themselves, or their own teammates.
181-
const requester = authResult.user;
182-
const isPrivileged =
183-
requester.role === "admin" || requester.role === "evaluator";
184-
const isSelf = requester.uid === user.uid;
185-
const isTeammate =
186-
!!requester.teamCode &&
187-
!!user.teamCode &&
188-
requester.teamCode === user.teamCode;
189-
190-
if (!user.isLooking && !isPrivileged && !isSelf && !isTeammate) {
191-
return NextResponse.json(
192-
{
193-
message: "This profile is private",
194-
status: "error",
195-
},
196-
{ status: 403 },
197-
);
198-
}
199-
200178
return NextResponse.json({
201179
message: "User found",
202180
status: "success",

0 commit comments

Comments
 (0)